为什么DelayedJob忽略delayed_job_config.rb?

时间:2012-12-16 23:26:50

标签: ruby-on-rails ruby-on-rails-3 delayed-job

我有以下内容:

/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

这里的问题是没有使用设置:

$ 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 

任何想法在这里有什么问题?感谢

1 个答案:

答案 0 :(得分:1)

配置如下:

config/initializers/delayed_job_config.rb

文档为here