gitlab-org--gitlab-foss/lib/tasks/sidekiq.rake

29 lines
968 B
Ruby
Raw Normal View History

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