Commit a3fde7ec

mo khan <mo@mokhan.ca>
2014-08-23 14:30:45
restart delayed jobs and unicorn after deployment.
1 parent 889ffa6
Changed files (3)
config/deploy.rb
@@ -52,6 +52,8 @@ namespace :deploy do
     on roles(:app), in: :sequence, wait: 5 do
       # Your restart mechanism here, for example:
       # execute :touch, release_path.join('tmp/restart.txt')
+       invoke 'delayed_job:restart'
+       invoke 'unicorn:restart'
     end
   end
 
lib/capistrano/tasks/delayed_job.rake
@@ -6,14 +6,12 @@ namespace :delayed_job do
         execute :sudo, "service delayed_job_#{fetch(:application)} #{command}"
       end
     end
-    #after "deploy:#{command}", "delayed_job:#{command}"
-    #after "deploy:finish", "delayed_job:restart"
   end
 
   desc "tail the delayed jobs logs on an app server (cap staging delayed_job:logs)"
   task :logs do
     on roles(:app) do
-      stream "tail -f #{fetch(:shared_path)}/log/delayed_job.log"
+      stream "tail -F #{fetch(:shared_path)}/log/delayed_job.log"
     end
   end
 end
lib/capistrano/tasks/unicorn.rake
@@ -6,7 +6,6 @@ namespace :unicorn do
         execute "service unicorn_#{fetch(:application)} #{command}"
       end
     end
-    #after "deploy:finished", "unicorn:restart"
   end
 
   desc "tail the logs on an app server (cap staging unicorn:logs)"