From b40d393b47bb9e3ec8294cbe96fe8a7d1076c05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Cerrini?= Date: Sun, 15 Mar 2020 19:56:13 -0300 Subject: [PATCH 1/2] Updated deprecated `:environment`option --- lib/mina/delayed_job/tasks.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mina/delayed_job/tasks.rb b/lib/mina/delayed_job/tasks.rb index 99f5e36..d59cc80 100644 --- a/lib/mina/delayed_job/tasks.rb +++ b/lib/mina/delayed_job/tasks.rb @@ -9,7 +9,7 @@ namespace :delayed_job do desc 'Stop delayed_job' - task stop: :environment do + task stop: :remote_environment do comment 'Stop delayed_job' in_path(fetch(:current_path)) do command "RAILS_ENV='#{fetch(:rails_env)}' #{fetch(:delayed_job)} #{fetch(:delayed_job_additional_params)} stop --pid-dir='#{fetch(:shared_path)}/#{fetch(:delayed_job_pid_dir)}'" @@ -17,7 +17,7 @@ end desc 'Start delayed_job' - task start: :environment do + task start: :remote_environment do comment 'Start delayed_job' in_path(fetch(:current_path)) do command "RAILS_ENV='#{fetch(:rails_env)}' #{fetch(:delayed_job)} #{fetch(:delayed_job_additional_params)} start -n #{fetch(:delayed_job_processes)} --pid-dir='#{fetch(:shared_path)}/#{fetch(:delayed_job_pid_dir)}'" @@ -25,7 +25,7 @@ end desc 'Restart delayed_job' - task restart: :environment do + task restart: :remote_environment do comment 'Restart delayed_job' in_path(fetch(:current_path)) do command "RAILS_ENV='#{fetch(:rails_env)}' #{fetch(:delayed_job)} #{fetch(:delayed_job_additional_params)} restart -n #{fetch(:delayed_job_processes)} --pid-dir='#{fetch(:shared_path)}/#{fetch(:delayed_job_pid_dir)}'" @@ -33,7 +33,7 @@ end desc 'delayed_job status' - task status: :environment do + task status: :remote_environment do comment 'Delayed job Status' in_path(fetch(:current_path)) do command "RAILS_ENV='#{fetch(:rails_env)}' #{fetch(:delayed_job)} #{fetch(:delayed_job_additional_params)} status --pid-dir='#{fetch(:shared_path)}/#{fetch(:delayed_job_pid_dir)}'" From 9aed309a9864aa9fe443a2b237d8e3214e043d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Cerrini?= Date: Sun, 15 Mar 2020 20:39:36 -0300 Subject: [PATCH 2/2] Moved default `pids` directory to the standard `shared/pids` --- lib/mina/delayed_job/tasks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mina/delayed_job/tasks.rb b/lib/mina/delayed_job/tasks.rb index d59cc80..fb59a46 100644 --- a/lib/mina/delayed_job/tasks.rb +++ b/lib/mina/delayed_job/tasks.rb @@ -2,7 +2,7 @@ require 'mina/rails' set :delayed_job, 'bin/delayed_job' -set :delayed_job_pid_dir, 'pids' +set :delayed_job_pid_dir, 'shared/pids' set :delayed_job_processes, 1 set :delayed_job_additional_params, '' set :shared_dirs, fetch(:shared_dirs, []).push(fetch(:delayed_job_pid_dir))