summaryrefslogtreecommitdiff
path: root/lib/tasks/sidekiq.rake
blob: 01da919d7f8ab22f97ddf5b0709b8761114c5659 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
namespace :sidekiq do
  desc "GITLAB | Stop sidekiq"
  task :stop do
    run "bundle exec sidekiqctl stop #{pidfile}"
  end

  desc "GITLAB | Start sidekiq"
  task :start do
    run "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &"
  end

  def pidfile
    Rails.root.join("tmp", "pids", "sidekiq.pid")
  end
end