2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-20 18:52:44 +08:00

FIX: Heartbeat check per sidekiq process (#7873)

* FIX: Heartbeat check per sidekiq process

* Rename method

* Remove heartbeat queues of previous bootups

* Regis feedback

* Refactor before_start

* Update lib/demon/sidekiq.rb

Co-Authored-By: Régis Hanol <regis@hanol.fr>

* Update lib/demon/sidekiq.rb

Co-Authored-By: Régis Hanol <regis@hanol.fr>

* Expire redis keys after 3600 seconds

* Don't use redis to store the list of queues
This commit is contained in:
Osama Sayegh 2019-08-26 09:33:49 +03:00 committed by GitHub
parent 208c638900
commit 340855da55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 34 deletions

View file

@ -11,6 +11,7 @@ class Demon::Base
def self.start(count = 1, verbose: false)
@demons ||= {}
before_start(count)
count.times do |i|
(@demons["#{prefix}_#{i}"] ||= new(i, verbose: verbose)).start
end
@ -37,7 +38,10 @@ class Demon::Base
end
end
attr_reader :pid, :parent_pid, :started, :index
def self.before_start(count)
end
attr_reader :pid, :parent_pid, :started, :index, :identifier
attr_accessor :stop_timeout
def initialize(index, rails_root: nil, parent_pid: nil, verbose: false)