Sha256: c09b287d83d6a4f895711bccdc0931f8d80628195f3d987bcbae8a0b4e760243

Contents?: true

Size: 657 Bytes

Versions: 36

Compression:

Stored size: 657 Bytes

Contents

module QuickTravel
  class Status
    def self.key
      # NOTE: This is not pretty, but we need to use a unique key per server
      @key ||= "status-check##{SecureRandom.hex}"
    end

    def self.check!
      # Test Cache
      QuickTravel::Cache.delete(key)
      QuickTravel::Cache.cache(key) { 'start' }
      unless QuickTravel::Cache.cache(key) == 'start'
        fail RuntimeError, 'Failed to cache status-check'
      end

      QuickTravel::Cache.delete(key)
      QuickTravel::Cache.cache(key) { nil }
      unless QuickTravel::Cache.cache(key) == nil
        fail RuntimeError, 'Failed to clear status-check cache'
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
quicktravel_client-4.7.0 lib/quick_travel/status.rb
quicktravel_client-4.6.0 lib/quick_travel/status.rb
quicktravel_client-4.5.0 lib/quick_travel/status.rb
quicktravel_client-4.4.0 lib/quick_travel/status.rb
quicktravel_client-4.3.2 lib/quick_travel/status.rb
quicktravel_client-4.3.1 lib/quick_travel/status.rb
quicktravel_client-4.3.0 lib/quick_travel/status.rb
quicktravel_client-4.2.0 lib/quick_travel/status.rb
quicktravel_client-4.1.0 lib/quick_travel/status.rb
quicktravel_client-4.0.0 lib/quick_travel/status.rb
quicktravel_client-3.9.0 lib/quick_travel/status.rb
quicktravel_client-3.8.1 lib/quick_travel/status.rb
quicktravel_client-3.8.0 lib/quick_travel/status.rb
quicktravel_client-3.7.0 lib/quick_travel/status.rb
quicktravel_client-3.6.1 lib/quick_travel/status.rb
quicktravel_client-3.6.0 lib/quick_travel/status.rb
quicktravel_client-3.5.0 lib/quick_travel/status.rb
quicktravel_client-3.4.0 lib/quick_travel/status.rb
quicktravel_client-3.3.0 lib/quick_travel/status.rb
quicktravel_client-3.2.0 lib/quick_travel/status.rb