Class: PatientHttp::Sidekiq::LifecycleHooks

Inherits:
Object
  • Object
show all
Defined in:
lib/patient_http/sidekiq/lifecycle_hooks.rb

Class Method Summary collapse

Class Method Details

.registerObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/patient_http/sidekiq/lifecycle_hooks.rb', line 18

def register
  return if @registered

  PatientHttp::Sidekiq.append_middleware

  ::Sidekiq.configure_server do |config|
    config.on(:startup) do
      PatientHttp::Sidekiq.start
    end

    config.on(:quiet) do
      PatientHttp::Sidekiq.quiet
    end

    config.on(:shutdown) do
      PatientHttp::Sidekiq.stop
    end

    @registered = true
  end
end