Module: Ready::For::Migration::HealthActionInspectable

Included in:
HealthController
Defined in:
app/controllers/concerns/ready/for/migration/health_action_inspectable.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cacheObject



8
9
10
# File 'app/controllers/concerns/ready/for/migration/health_action_inspectable.rb', line 8

def self.cache
  @cache ||= ActiveSupport::Cache::MemoryStore.new
end

.sleep_enabled?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/concerns/ready/for/migration/health_action_inspectable.rb', line 12

def self.sleep_enabled?
  return false if ENV['RFM_ENABLE_SLEEP'].nil?
  b = [ false, 0,
        "0", :"0",
        "f", :f,
        "F", :F,
        "false", :false,
        "FALSE", :FALSE,
        "off", :off,
        "OFF", :OFF,
      ].include?(ENV['RFM_ENABLE_SLEEP'])
  return !b
end

Instance Method Details

#readinessObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/concerns/ready/for/migration/health_action_inspectable.rb', line 26

def readiness
  if params.has_key?(:status)
    case
    when params.has_key?(:after)
      perform_inspection_with_status_and_after
    when params.has_key?(:sleep)
      perform_inspection_with_status_and_sleep
    when params.has_key?(:random)
      perform_inspection_with_status_and_random
    else
      perform_inspection_with_status
    end
  elsif params.has_key?(:sleep)
    perform_inspection_with_sleep
  end

  super unless performed?
end