Add SELF_DESTRUCT env variable to process self-destructions in the background (#26439)
This commit is contained in:
parent
26d2a2a0cc
commit
379115e601
22 changed files with 193 additions and 57 deletions
|
@ -17,6 +17,18 @@ Sidekiq.configure_server do |config|
|
|||
chain.add SidekiqUniqueJobs::Middleware::Client
|
||||
end
|
||||
|
||||
config.on(:startup) do
|
||||
if SelfDestructHelper.self_destruct?
|
||||
Sidekiq.schedule = {
|
||||
'self_destruct_scheduler' => {
|
||||
'interval' => ['1m'],
|
||||
'class' => 'Scheduler::SelfDestructScheduler',
|
||||
'queue' => 'scheduler',
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
SidekiqUniqueJobs::Server.configure(config)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue