diff --git a/VERSION b/VERSION index c78c4964..32b93c0c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.2 +4.7.7 diff --git a/config/application.rb b/config/application.rb index 71830f8e..e958a84f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -73,5 +73,9 @@ class Application < Rails::Application config.active_job.queue_adapter = :async config.active_storage.service = :local + + ENVIRONMENTS = Dir.glob(Rails.root.join("config/environments/*.rb")).map { |file| + File.basename(file, ".rb") + }.freeze end end diff --git a/lib/tasks/resque.rake b/lib/tasks/resque.rake index ab907e2f..95437164 100644 --- a/lib/tasks/resque.rake +++ b/lib/tasks/resque.rake @@ -96,14 +96,14 @@ namespace :resque do err = Rails.root.join('log', 'resque.log').to_s out = Rails.root.join('log', 'resque.log').to_s rails_env = ENV['RAILS_ENV'] + return unless AcademicCommons::Application::ENVIRONMENTS.include?(rails_env) worker_config.each do |queues, count| queues = queues.to_s count.times do |index| number = index + 1 pidfile = Rails.root.join('tmp/pids/', "resque_work_#{number}.pid").to_s - _stdout_str, _stderr_str, status = Open3.capture3("RAILS_ENV=#{rails_env} QUEUE=\"#{queues}\" PIDFILE=#{pidfile} BACKGROUND=yes VERBOSE=1 INTERVAL=#{interval} rake resque:work >> #{out} 2>> #{err}") - puts "Worker #{number} started, status: #{status}" + Open3.capture3("RAILS_ENV=#{rails_env} QUEUE=\"#{queues}\" PIDFILE=#{pidfile} BACKGROUND=yes VERBOSE=1 INTERVAL=#{interval} rake resque:work >> #{out} 2>> #{err}") end end end