From b0b9dae59611821d8af05fd1019055965a1c2ad1 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Tue, 3 Feb 2015 14:13:21 +0200 Subject: [PATCH] Delayed job restart on deploy --- config/deploy.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/deploy.rb b/config/deploy.rb index 59bc02218..65eda91bf 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -132,6 +132,8 @@ task deploy: :environment do invoke :'rails:assets_precompile' to :launch do invoke :restart + invoke :'delayed_job:stop' + invoke :'delayed_job:start' end end end @@ -157,6 +159,16 @@ task load_commit_hash: :environment do ) end +namespace :delayed_job do + task :stop do + queue "cd #{deploy_to}/current; bin/delayed_job stop" + end + + task :start do + queue "cd #{deploy_to}/current; bin/delayed_job start" + end +end + desc 'Restart Passenger application' task restart: :environment do queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"