lib/good_job/configuration.rb in good_job-3.24.0 vs lib/good_job/configuration.rb in good_job-3.25.0
- old
+ new
@@ -29,10 +29,12 @@
DEFAULT_ENABLE_CRON = false
# Default to enabling LISTEN/NOTIFY
DEFAULT_ENABLE_LISTEN_NOTIFY = true
# Default Dashboard I18n locale
DEFAULT_DASHBOARD_DEFAULT_LOCALE = :en
+ # Default Dashboard Live Poll button enabled
+ DEFAULT_DASHBOARD_LIVE_POLL_ENABLED = true
def self.validate_execution_mode(execution_mode)
raise ArgumentError, "GoodJob execution mode must be one of #{EXECUTION_MODES.join(', ')}. It was '#{execution_mode}' which is not valid." unless execution_mode.in?(EXECUTION_MODES)
end
@@ -202,13 +204,14 @@
alias enable_cron? enable_cron
def cron
env_cron = JSON.parse(ENV.fetch('GOOD_JOB_CRON'), symbolize_names: true) if ENV['GOOD_JOB_CRON'].present?
+ rails_config_cron = rails_config[:cron].presence
options[:cron] ||
- rails_config[:cron] ||
+ rails_config_cron ||
env_cron ||
{}
end
def cron_entries
@@ -376,9 +379,15 @@
rails_config[:smaller_number_is_higher_priority]
end
def dashboard_default_locale
rails_config[:dashboard_default_locale] || DEFAULT_DASHBOARD_DEFAULT_LOCALE
+ end
+
+ def dashboard_live_poll_enabled
+ return rails_config[:dashboard_live_poll_enabled] unless rails_config[:dashboard_live_poll_enabled].nil?
+
+ DEFAULT_DASHBOARD_LIVE_POLL_ENABLED
end
# Whether running in a web server process.
# @return [Boolean, nil]
def in_webserver?