summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-21 15:11:06 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-21 15:11:06 +0300
commitd6444004e19df77f559e4db5b42ea56045da4690 (patch)
tree2f94ed3e53714bb6d1fc4af90129567c4b9c5552
parentb595503968078e583ed2715840095719d72e4f3b (diff)
parent0dd94f2215022e1fd80ca66183b2bce018c81a78 (diff)
downloadgitlab-ce-d6444004e19df77f559e4db5b42ea56045da4690.tar.gz
Merge branch '6-1-stable' of dev.gitlab.org:gitlab/gitlabhq into 6-1-stable
-rw-r--r--lib/tasks/sidekiq.rake18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/tasks/sidekiq.rake b/lib/tasks/sidekiq.rake
index d0e9dfe46a1..ba79b6e035d 100644
--- a/lib/tasks/sidekiq.rake
+++ b/lib/tasks/sidekiq.rake
@@ -5,16 +5,28 @@ namespace :sidekiq do
end
desc "GITLAB | Start sidekiq"
- task :start do
- 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 &"
+ 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 "bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} -d -L #{log_file} >> #{log_file} 2>&1"
end
desc "GITLAB | Start sidekiq with launchd on Mac OS X"
task :launchd do
- system "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 "bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{log_file} 2>&1"
end
def pidfile
Rails.root.join("tmp", "pids", "sidekiq.pid")
end
+
+ def log_file
+ Rails.root.join("log", "sidekiq.log")
+ end
end