Permalink
Browse files

fix README: configs are cattrs on Delayed::Worker

  • Loading branch information...
1 parent 719b628 commit 9eb012d6d76b01fe897bfb9e13133e38e6a5e675 @bonkydog committed Aug 24, 2011
Showing with 4 additions and 6 deletions.
  1. +4 −6 README.textile
View
@@ -44,17 +44,15 @@ The default @MAX_RUN_TIME@ is @4.hours@. If your job takes longer than that, ano
make sure your job doesn't exceed this time. You should set this to the longest time you think the job could take.
By default, it will delete failed jobs (and it always deletes successful jobs). If you want to keep failed jobs, set
-@Delayed::Job.destroy_failed_jobs = false@. The failed jobs will be marked with non-null failed_at.
+@Delayed::Worker.destroy_failed_jobs = false@. The failed jobs will be marked with non-null failed_at.
Here is an example of changing job parameters in Rails:
<pre><code>
# config/initializers/delayed_job_config.rb
- 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
+ Delayed::Worker.destroy_failed_jobs = false
+ Delayed::Worker.max_attempts = 3
+ Delayed::Worker.max_run_time = 5.minutes
</code></pre>
Note: If your error messages are long, consider changing last_error field to a :text instead of a :string (255 character limit).

0 comments on commit 9eb012d

Please sign in to comment.