1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Automatically use config/sidekiq.yml if found, fixes #1481

This commit is contained in:
Mike Perham 2014-02-15 12:41:07 -08:00
parent f6de1fa745
commit 315db463cf
4 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,7 @@
HEAD
2.17.5
-----------
- Automatically use the config file found at `config/sidekiq.yml`, if not passed `-C`. [#1481]
- Store 'retried\_at' and 'failed\_at' timestamps as Floats, not Strings. [#1473]
- A `USR2` signal will now reopen _all_ logs, using IO#reopen. Thus, instead of creating a new Logger object,
Sidekiq will now just update the existing Logger's file descriptor [#1163].

View file

@ -40,7 +40,7 @@ Capistrano::Configuration.instance.load do
task :start, :roles => lambda { fetch(:sidekiq_role) }, :on_no_matching_servers => :continue do
rails_env = fetch(:rails_env, "production")
for_each_process do |pid_file, idx|
run "cd #{current_path} ; nohup #{fetch(:sidekiq_cmd)} -e #{rails_env} -C #{current_path}/config/sidekiq.yml -i #{idx} -P #{pid_file} >> #{current_path}/log/sidekiq.log 2>&1 &", :pty => false
run "cd #{current_path} ; nohup #{fetch(:sidekiq_cmd)} -e #{rails_env} -i #{idx} -P #{pid_file} >> #{current_path}/log/sidekiq.log 2>&1 &", :pty => false
end
end

View file

@ -299,6 +299,7 @@ module Sidekiq
die 1
end
@parser.parse!(argv)
opts[:config_file] ||= 'config/sidekiq.yml' if File.exist?('config/sidekiq.yml')
opts
end

View file

@ -15,7 +15,7 @@ namespace :load do
set :sidekiq_pid, ->{ "tmp/sidekiq.pid" }
# "-d -i INT -P PATH" are added automatically.
set :sidekiq_options, ->{ "-e #{fetch(:rails_env, 'production')} -C #{current_path}/config/sidekiq.yml -L #{current_path}/log/sidekiq.log" }
set :sidekiq_options, ->{ "-e #{fetch(:rails_env, 'production')} -L #{current_path}/log/sidekiq.log" }
set :sidekiq_timeout, ->{ 10 }
set :sidekiq_role, ->{ :app }