简体   繁体   中英

Why is DelayedJob is ignoring delayed_job_config.rb?

I have the following:

/config/delayed_job_config.rb

# Enable DelayedJob Logging
Delayed::Worker.logger = Rails.logger
Delayed::Worker.logger.auto_flushing = 1

# Do not delete failed jobs (default is true)
Delayed::Worker.destroy_failed_jobs = false

# Dont wait so long between jobs
Delayed::Worker.read_ahead = 100 # default was 5
Delayed::Worker.sleep_delay = 1 #default was 5

Problem here is the settings are not being used:

$ rails c
Loading development environment (Rails 3.2.5)
1.9.3-p125 :001 > Delayed::Worker.read_ahead
 => 5 
1.9.3-p125 :002 > Delayed::Worker.sleep_delay
 => 5 

Any ideas what's wrong here? Thanks

The configuration goes in:

config/initializers/delayed_job_config.rb

Documentation is here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM