Commit 2128419c5b42905a20e2d459fa11c8e4680ed58f
1 parent
7af1bc3b
Exists in
master
and in
4 other branches
Always shut down sidekiq before starting
Showing
1 changed file
with
9 additions
and
1 deletions
Show diff stats
lib/tasks/sidekiq.rake
... | ... | @@ -5,7 +5,15 @@ namespace :sidekiq do |
5 | 5 | end |
6 | 6 | |
7 | 7 | desc "GITLAB | Start sidekiq" |
8 | - task :start do | |
8 | + task :start => :restart | |
9 | + | |
10 | + desc 'GitLab | Restart sidekiq' | |
11 | + task :restart do | |
12 | + if File.exist?(pidfile) | |
13 | + puts 'Shutting down existing sidekiq process.' | |
14 | + Rake::Task['sidekiq:stop'].invoke | |
15 | + puts 'Starting new sidekiq process.' | |
16 | + end | |
9 | 17 | 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 &" |
10 | 18 | end |
11 | 19 | ... | ... |