diff options
Diffstat (limited to 'config/initializers/sidekiq_cluster.rb')
-rw-r--r-- | config/initializers/sidekiq_cluster.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/config/initializers/sidekiq_cluster.rb b/config/initializers/sidekiq_cluster.rb index 4ff8dd9b936..2f9c1de47eb 100644 --- a/config/initializers/sidekiq_cluster.rb +++ b/config/initializers/sidekiq_cluster.rb @@ -14,10 +14,10 @@ if ENV['ENABLE_SIDEKIQ_CLUSTER'] if Process.ppid != parent Process.kill(:TERM, Process.pid) - # Wait for just a few extra seconds for a final attempt to - # gracefully terminate. Considering the parent (cluster) process - # have changed (SIGKILL'd), it shouldn't take long to shutdown. - sleep(5) + # Allow sidekiq to cleanly terminate and push any running jobs back + # into the queue. We use the configured timeout and add a small + # grace period + sleep(Sidekiq.options[:timeout] + 5) # Signaling the Sidekiq Pgroup as KILL is not forwarded to # a possible child process. In Sidekiq Cluster, all child Sidekiq |