mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:23:25 +08:00
Allow multiple host when restricting Sidekiq queues.
This commit is contained in:
parent
be44e4b730
commit
7ea288140d
|
@ -23,7 +23,7 @@ if Sidekiq.server?
|
|||
Rails.application.config.after_initialize do
|
||||
scheduler_hostname = ENV["UNICORN_SCHEDULER_HOSTNAME"]
|
||||
|
||||
if !scheduler_hostname || scheduler_hostname == `hostname`.strip
|
||||
if !scheduler_hostname || scheduler_hostname.split(',').include?(`hostname`.strip)
|
||||
require 'scheduler/scheduler'
|
||||
manager = Scheduler::Manager.new
|
||||
Scheduler::Manager.discover_schedules.each do |schedule|
|
||||
|
|
|
@ -37,7 +37,7 @@ class Demon::Sidekiq < Demon::Base
|
|||
[['critical', 4], ['default', 2], ['low', 1]].each do |queue_name, weight|
|
||||
custom_queue_hostname = ENV["UNICORN_SIDEKIQ_#{queue_name.upcase}_QUEUE_HOSTNAME"]
|
||||
|
||||
if !custom_queue_hostname || custom_queue_hostname == `hostname`.strip
|
||||
if !custom_queue_hostname || custom_queue_hostname.split(',').include?(`hostname`.strip)
|
||||
options << "-q"
|
||||
options << "#{queue_name},#{weight}"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user