2013-01-09 05:44:05 +00:00
|
|
|
namespace :sidekiq do
|
|
|
|
desc "GITLAB | Stop sidekiq"
|
|
|
|
task :stop do
|
2013-02-27 18:40:01 +00:00
|
|
|
system "bundle exec sidekiqctl stop #{pidfile}"
|
2013-01-09 05:44:05 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "GITLAB | Start sidekiq"
|
2013-10-09 13:44:25 +00:00
|
|
|
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
|
2013-10-09 13:46:00 +00:00
|
|
|
system "nohup 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 &"
|
2013-01-09 05:44:05 +00:00
|
|
|
end
|
2013-02-27 18:40:01 +00:00
|
|
|
|
2013-02-12 15:01:55 +00:00
|
|
|
desc "GITLAB | Start sidekiq with launchd on Mac OS X"
|
|
|
|
task :launchd do
|
2013-10-09 13:46:00 +00:00
|
|
|
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"
|
2013-02-12 15:01:55 +00:00
|
|
|
end
|
2013-02-27 18:40:01 +00:00
|
|
|
|
2013-01-09 05:44:05 +00:00
|
|
|
def pidfile
|
2013-01-09 22:56:47 +00:00
|
|
|
Rails.root.join("tmp", "pids", "sidekiq.pid")
|
2013-01-09 05:44:05 +00:00
|
|
|
end
|
2013-10-09 13:46:00 +00:00
|
|
|
|
|
|
|
def log_file
|
|
|
|
Rails.root.join("log", "sidekiq.log")
|
|
|
|
end
|
2013-01-09 05:44:05 +00:00
|
|
|
end
|