Class: SuperSettings::Context::SidekiqMiddleware
- Inherits:
-
Object
- Object
- SuperSettings::Context::SidekiqMiddleware
- Includes:
- Sidekiq::ServerMiddleware
- Defined in:
- lib/super_settings/context/sidekiq_middleware.rb
Overview
Sidekiq middleware you can use to add a context to your jobs so that settings are not changed during job execution.
You can disable the context by setting the ‘super_settings_context` key to `false` in the job payload.
Instance Method Summary collapse
Instance Method Details
#call(job_instance, job_payload, queue) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/super_settings/context/sidekiq_middleware.rb', line 30 def call(job_instance, job_payload, queue) if job_payload["super_settings_context"] == false yield else SuperSettings.context do yield end end end |