Class: StandardHealth::Checks::SolidCache
- Inherits:
-
StandardHealth::Check
- Object
- StandardHealth::Check
- StandardHealth::Checks::SolidCache
- 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
Instance Method Summary collapse
-
#initialize(name: :solid_cache, critical: false) ⇒ SolidCache
constructor
A new instance of SolidCache.
- #run ⇒ Object
Methods inherited from StandardHealth::Check
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
#run ⇒ Object
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 |