mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
DEV: Retry on distributed mutex timeout error when starting sidekiq.
We need Sidekiq to start `mini_scheduler` no matter what. Timeouts happen when trying to boot an app with Redis in readonly mode.
This commit is contained in:
parent
e92909aa77
commit
27b2e335ef
@ -70,7 +70,12 @@ if Sidekiq.server?
|
|||||||
scheduler_hostname = ENV["UNICORN_SCHEDULER_HOSTNAME"]
|
scheduler_hostname = ENV["UNICORN_SCHEDULER_HOSTNAME"]
|
||||||
|
|
||||||
if !scheduler_hostname || scheduler_hostname.split(',').include?(Discourse.os_hostname)
|
if !scheduler_hostname || scheduler_hostname.split(',').include?(Discourse.os_hostname)
|
||||||
MiniScheduler.start(workers: GlobalSetting.mini_scheduler_workers)
|
begin
|
||||||
|
MiniScheduler.start(workers: GlobalSetting.mini_scheduler_workers)
|
||||||
|
rescue MiniScheduler::DistributedMutex::Timeout
|
||||||
|
sleep 5
|
||||||
|
retry
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user