lib/good_job/cli.rb in good_job-3.3.0 vs lib/good_job/cli.rb in good_job-3.3.1
- old
+ new
@@ -83,11 +83,12 @@
type: :numeric,
desc: "Port for http health check (env var: GOOD_JOB_PROBE_PORT, default: nil)"
def start
set_up_application!
- configuration = GoodJob::Configuration.new(options)
+ GoodJob.configuration.options.merge!(options.symbolize_keys)
+ configuration = GoodJob.configuration
Daemon.new(pidfile: configuration.pidfile).daemonize if configuration.daemonize?
notifier = GoodJob::Notifier.new
poller = GoodJob::Poller.new(poll_interval: configuration.poll_interval)
@@ -140,13 +141,12 @@
banner: 'SECONDS',
desc: "Destroy records finished more than this many seconds ago (env var: GOOD_JOB_CLEANUP_PRESERVED_JOBS_BEFORE_SECONDS_AGO, default: 86400)"
def cleanup_preserved_jobs
set_up_application!
+ GoodJob.configuration.options.merge!(options.symbolize_keys)
- configuration = GoodJob::Configuration.new(options)
-
- GoodJob.cleanup_preserved_jobs(older_than: configuration.cleanup_preserved_jobs_before_seconds_ago)
+ GoodJob.cleanup_preserved_jobs(older_than: GoodJob.configuration.cleanup_preserved_jobs_before_seconds_ago)
end
no_commands do
# Load the current Rails application and configuration that the good_job
# command-line tool should be working within.