diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2013-10-09 15:44:25 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2013-10-09 15:51:39 +0200 |
commit | 2128419c5b42905a20e2d459fa11c8e4680ed58f (patch) | |
tree | acb9b03963d8709ce2bed53e32ecdbf59d1a8ceb /lib/tasks/sidekiq.rake | |
parent | 7af1bc3b88e3a32cb07d7aee7962af22c2339c02 (diff) | |
download | gitlab-ce-2128419c5b42905a20e2d459fa11c8e4680ed58f.tar.gz |
Always shut down sidekiq before starting
Diffstat (limited to 'lib/tasks/sidekiq.rake')
-rw-r--r-- | lib/tasks/sidekiq.rake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/tasks/sidekiq.rake b/lib/tasks/sidekiq.rake index d0e9dfe46a1..e71cf0380ed 100644 --- a/lib/tasks/sidekiq.rake +++ b/lib/tasks/sidekiq.rake @@ -5,7 +5,15 @@ namespace :sidekiq do end 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 &" end |