lib/good_job/configuration.rb in good_job-1.13.1 vs lib/good_job/configuration.rb in good_job-1.13.2
- old
+ new
@@ -5,11 +5,11 @@
# the rest of GoodJob. It combines environment information with explicitly
# set options to get the final values for each option.
#
class Configuration
# Valid execution modes.
- EXECUTION_MODES = [:async, :async_server, :external, :inline].freeze
+ EXECUTION_MODES = [:async, :async_all, :async_server, :external, :inline].freeze
# Default number of threads to use per {Scheduler}
DEFAULT_MAX_THREADS = 5
# Default number of seconds between polls for jobs
DEFAULT_POLL_INTERVAL = 10
# Default number of threads to use per {Scheduler}
@@ -56,10 +56,21 @@
rails_config[:execution_mode] ||
env['GOOD_JOB_EXECUTION_MODE']
end
if mode
- mode.to_sym
+ mode_sym = mode.to_sym
+ if mode_sym == :async
+ ActiveSupport::Deprecation.warn <<~DEPRECATION
+ The next major version of GoodJob will redefine the meaning of 'async'
+ execution mode to be equivalent to 'async_server' and only execute
+ within the webserver process.
+
+ To continue using the v1.0 semantics of 'async', use `async_all` instead.
+
+ DEPRECATION
+ end
+ mode_sym
elsif Rails.env.development? || Rails.env.test?
:inline
else
:external
end