lib/good_job/configuration.rb in good_job-2.7.1 vs lib/good_job/configuration.rb in good_job-2.7.2
- old
+ new
@@ -48,27 +48,25 @@
# Specifies how and where jobs should be executed. See {Adapter#initialize}
# for more details on possible values.
# @return [Symbol]
def execution_mode
- @_execution_mode ||= begin
- mode = if GoodJob::CLI.within_exe?
- :external
- else
- options[:execution_mode] ||
- rails_config[:execution_mode] ||
- env['GOOD_JOB_EXECUTION_MODE']
- end
+ mode = if GoodJob::CLI.within_exe?
+ :external
+ else
+ options[:execution_mode] ||
+ rails_config[:execution_mode] ||
+ env['GOOD_JOB_EXECUTION_MODE']
+ end
- if mode
- mode.to_sym
- elsif Rails.env.development?
- :async
- elsif Rails.env.test?
- :inline
- else
- :external
- end
+ if mode
+ mode.to_sym
+ elsif Rails.env.development?
+ :async
+ elsif Rails.env.test?
+ :inline
+ else
+ :external
end
end
# Indicates the number of threads to use per {Scheduler}. Note that
# {#queue_string} may provide more specific thread counts to use with