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

33 lines
984 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-10-09 13:48:28 +00:00
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
2013-02-27 18:40:01 +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"
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
2013-10-09 13:46:00 +00:00
def log_file
Rails.root.join("log", "sidekiq.log")
end
end