Commit 2128419c authored by Jacob Vosmaer's avatar Jacob Vosmaer

Always shut down sidekiq before starting

parent 7af1bc3b
...@@ -5,7 +5,15 @@ namespace :sidekiq do ...@@ -5,7 +5,15 @@ namespace :sidekiq do
end end
desc "GITLAB | Start sidekiq" desc "GITLAB | Start sidekiq"
task :start do task :start => :restart
desc 'GitLab | Restart sidekiq'
task :restart do
if File.exist?(pidfile)
puts 'Shutting down existing sidekiq process.'
Rake::Task['sidekiq:stop'].invoke
puts 'Starting new sidekiq process.'
end
system "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &" system "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &"
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment