From: Riyad Preukschas Date: Wed, 9 Jan 2013 22:56:47 +0000 (+0100) Subject: Fix sidekiq task to use Rails X-Git-Tag: v4.1.0~101 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4eac403e3b3a32188c48d006e431ee838cd5c3dc;p=wvm%2Fgitlab.git Fix sidekiq task to use Rails --- diff --git a/lib/tasks/sidekiq.rake b/lib/tasks/sidekiq.rake index 6bbcb3da4..01da919d7 100644 --- a/lib/tasks/sidekiq.rake +++ b/lib/tasks/sidekiq.rake @@ -6,18 +6,10 @@ namespace :sidekiq do desc "GITLAB | Start sidekiq" task :start do - run "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,common,default -e #{rails_env} -P #{pidfile} >> #{root_path}/log/sidekiq.log 2>&1 &" - end - - def root_path - @root_path ||= File.join(File.expand_path(File.dirname(__FILE__)), "../..") + run "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &" end def pidfile - "#{root_path}/tmp/pids/sidekiq.pid" - end - - def rails_env - ENV['RAILS_ENV'] || "production" + Rails.root.join("tmp", "pids", "sidekiq.pid") end end