Class: HttpHealthCheck::Probes::Sidekiq
- Inherits:
-
Object
- Object
- HttpHealthCheck::Probes::Sidekiq
- Includes:
- HttpHealthCheck::Probe
- Defined in:
- lib/http_health_check/probes/sidekiq.rb
Constant Summary collapse
- TTL_SEC =
3
- MAGIC_NUMBER =
42
Instance Method Summary collapse
-
#initialize(sidekiq: ::Sidekiq) ⇒ Sidekiq
constructor
A new instance of Sidekiq.
- #meta ⇒ Object
- #probe(_env) ⇒ Object
Methods included from HttpHealthCheck::Probe
#call, #probe_error, #probe_ok, #with_error_handler
Constructor Details
#initialize(sidekiq: ::Sidekiq) ⇒ Sidekiq
Returns a new instance of Sidekiq.
11 12 13 |
# File 'lib/http_health_check/probes/sidekiq.rb', line 11 def initialize(sidekiq: ::Sidekiq) @sidekiq_module = sidekiq end |
Instance Method Details
#meta ⇒ Object
22 23 24 |
# File 'lib/http_health_check/probes/sidekiq.rb', line 22 def @meta ||= { redis_key: redis_key } end |
#probe(_env) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/http_health_check/probes/sidekiq.rb', line 15 def probe(_env) @sidekiq_module.redis do |conn| conn.call('SET', [:redis_key], MAGIC_NUMBER, 'EX', TTL_SEC) probe_ok end end |