Commit 4eac403e3b3a32188c48d006e431ee838cd5c3dc

Authored by Riyad Preukschas
1 parent 6ea7bc27

Fix sidekiq task to use Rails

Showing 1 changed file with 2 additions and 10 deletions   Show diff stats
lib/tasks/sidekiq.rake
... ... @@ -6,18 +6,10 @@ namespace :sidekiq do
6 6  
7 7 desc "GITLAB | Start sidekiq"
8 8 task :start do
9   - 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 &"
10   - end
11   -
12   - def root_path
13   - @root_path ||= File.join(File.expand_path(File.dirname(__FILE__)), "../..")
  9 + 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 &"
14 10 end
15 11  
16 12 def pidfile
17   - "#{root_path}/tmp/pids/sidekiq.pid"
18   - end
19   -
20   - def rails_env
21   - ENV['RAILS_ENV'] || "production"
  13 + Rails.root.join("tmp", "pids", "sidekiq.pid")
22 14 end
23 15 end
... ...