Skip to content

Commit

Permalink
confirm resque task environment is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
JackBlackLight committed Oct 31, 2024
1 parent 6ae7e26 commit 60fabea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.6.2
4.7.7
4 changes: 4 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/tasks/resque.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 60fabea

Please sign in to comment.