Class: GranPulse::Cache
Instance Attribute Summary
Attributes inherited from Check
Instance Method Summary collapse
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
- #perform ⇒ Object
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
3 4 5 |
# File 'app/models/gran_pulse/cache.rb', line 3 def initialize self.type = 'cache' end |
Instance Method Details
#perform ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/models/gran_pulse/cache.rb', line 7 def perform if Rails.cache.write('__gran_pulse__', 'ok', :expires_in => 1.second) self.healthy = true self. = 'ok' else self.healthy = false self. = 'nok' end self end |