Class: StandardHealth::Checks::SolidCache

Inherits:
StandardHealth::Check show all
Defined in:
lib/standard_health/checks/solid_cache.rb

Overview

Verifies the Rails cache is reachable via a read-only probe.

We deliberately don’t write — a flapping cache shouldn’t corrupt host app cache state. If the read raises (connection refused, decoding error, etc.), the check fails. Non-critical by default: a degraded cache shouldn’t pull the app out of rotation.

Constant Summary collapse

PROBE_KEY =
"standard_health_probe"

Instance Attribute Summary

Attributes inherited from StandardHealth::Check

#critical, #name

Instance Method Summary collapse

Methods inherited from StandardHealth::Check

#critical?, #with_timing

Constructor Details

#initialize(name: :solid_cache, critical: false) ⇒ SolidCache

Returns a new instance of SolidCache.



16
17
18
# File 'lib/standard_health/checks/solid_cache.rb', line 16

def initialize(name: :solid_cache, critical: false)
  super
end

Instance Method Details

#runObject



20
21
22
23
24
# File 'lib/standard_health/checks/solid_cache.rb', line 20

def run
  with_timing do
    ::Rails.cache.read(PROBE_KEY)
  end
end