email via sidekiq. start and stop rake tasks
This commit is contained in:
parent
c7bb3a1f72
commit
71bd956866
15 changed files with 36 additions and 46 deletions
23
lib/tasks/sidekiq.rake
Normal file
23
lib/tasks/sidekiq.rake
Normal file
|
@ -0,0 +1,23 @@
|
|||
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} >> #{root_path}/log/sidekiq.log 2>&1 &"
|
||||
end
|
||||
|
||||
def root_path
|
||||
@root_path ||= File.join(File.expand_path(File.dirname(__FILE__)), "../..")
|
||||
end
|
||||
|
||||
def pidfile
|
||||
"#{root_path}/tmp/pids/sidekiq.pid"
|
||||
end
|
||||
|
||||
def rails_env
|
||||
ENV['RAILS_ENV'] || "production"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue