class DoctorStrange::Providers::Cache

Public Instance Methods

check!() click to toggle source
# File lib/doctor_strange/providers/cache.rb, line 8
def check!
  time = Time.now.to_s

  Rails.cache.write(key, time)
  fetched = Rails.cache.read(key)

  raise "different values (now: #{time}, fetched: #{fetched})" if fetched != time
rescue StandardError => e
  raise CacheException, e.message
end

Private Instance Methods

key() click to toggle source
# File lib/doctor_strange/providers/cache.rb, line 21
def key
  @key ||= ['health', request.try(:remote_ip)].join(':')
end