Class: GranPulse::Cache

Inherits:
Check
  • Object
show all
Defined in:
app/models/gran_pulse/cache.rb

Instance Attribute Summary

Attributes inherited from Check

#healthy, #message, #type

Instance Method Summary collapse

Constructor Details

#initializeCache

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

#performObject



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.message = 'ok'
  else
    self.healthy = false
    self.message = 'nok'
  end
  self
end