Skip to content

Commit

Permalink
Updated wording regarding reschedule_at
Browse files Browse the repository at this point in the history
  • Loading branch information
albus522 committed Oct 9, 2014
1 parent fea8f06 commit dfd0a26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ NewsletterJob = Struct.new(:text, :emails) do
end
```

On error, the job is scheduled again in 5 seconds + N ** 4, where N is the number of retries. This behavior can be overridden when you define `reschedule_at` method.
On error, the job is scheduled again in 5 seconds + N ** 4, where N is the number of attempts. You can define your own `reschedule_at` method to override this default behavior.

```ruby
NewsletterJob = Struct.new(:text, :emails) do
Expand Down Expand Up @@ -358,7 +358,7 @@ create_table :delayed_jobs, :force => true do |table|
end
```

On error, unless `reschedule_at` is defined, the job is scheduled again in 5 seconds + N ** 4, where N is the number of retries.
On error, the job is scheduled again in 5 seconds + N ** 4, where N is the number of attempts or using the job's defined `reschedule_at` method.

The default `Worker.max_attempts` is 25. After this, the job either deleted (default), or left in the database with "failed_at" set.
With the default of 25 attempts, the last retry will be 20 days later, with the last interval being almost 100 hours.
Expand Down

0 comments on commit dfd0a26

Please sign in to comment.