update sidekiq initializer to use the pausable middleware

This commit is contained in:
Régis Hanol 2014-02-12 20:30:33 -08:00
parent 8344f0d8fd
commit 0e686aca95

View file

@ -1,7 +1,17 @@
require "sidekiq/pausable"
sidekiq_redis = { url: $redis.url, namespace: 'sidekiq' }
Sidekiq.configure_client do |config|
config.redis = sidekiq_redis
end
Sidekiq.configure_server do |config|
config.redis = sidekiq_redis
# add our pausable middleware
config.server_middleware do |chain|
chain.add Sidekiq::Pausable
end
end
if Sidekiq.server?
@ -32,6 +42,4 @@ if Sidekiq.server?
end
end
Sidekiq.configure_client { |config| config.redis = sidekiq_redis }
Sidekiq.logger.level = Logger::WARN