Skip to content

Configuring delayed_job 2.x

October 6, 2010

I was configuring the delayed job and I got problems like :

`method_missing_without_paginate’: undefined method `destroy_failed_jobs=’

This is because I have 2.0.3 version of delayed job… The configuration parameters have all been moved to Delayed::Worker now and thus the following works for version 2.x:

Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 60
Delayed::Worker.max_attempts = 3
Delayed::Worker.max_run_time = 5.minutes

or the following:

Delayed::Worker.destroy_failed_jobs = false
silence_warnings do
Delayed::Worker.const_set("MAX_ATTEMPTS", 3)
Delayed::Worker.const_set("MAX_RUN_TIME", 5.minutes)
end

instead of

Delayed::Job.destroy_failed_jobs = false
silence_warnings do
Delayed::Job.const_set("MAX_ATTEMPTS", 3)
Delayed::Job.const_set("MAX_RUN_TIME", 5.minutes)
end

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: