Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating docs to more clearly state the retry behavior #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ Existing messages in the queue will be lost so please be aware of this.
% mix task_bunny.queue.reset
```

You need to redefine a queue when you want to change the retry interval for a queue.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer a valid statement, the expiration is now per message not per queue which was the case when this comment was added.



#### Umbrella app

Expand Down Expand Up @@ -314,7 +312,7 @@ TaskBunny marks the job failed when:
- `perform` times out.

TaskBunny retries the job automatically if the job has failed.
By default, it retries 10 times for every 5 minutes.
By default, it retries after at least 5 minutes, up to 10 times.

If you want to change it, you can override the value on a job module.

Expand All @@ -330,8 +328,9 @@ defmodule FlakyJob do
end
```

In this example, it will retry 100 times for every 10 seconds.
You can also change the retry_interval by the number of failures.
In this example, it will retry after a delay of 10 seconds up to 100 times.
You can also change the retry_interval by the number of failures, however the actual wait times may be longer
due to how RabbitMQ only expires messages from the front of the retry queue.

```elixir
def max_retry, do: 5
Expand Down
4 changes: 2 additions & 2 deletions lib/task_bunny/job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ defmodule TaskBunny.Job do

# Retry

By default TaskBunny retries 10 times every five minutes for a failed job.
By default TaskBunny retries after at least five minutes, up to 10 times for a failed job.
You can change this by overriding `max_retry/0` and `retry_interval/1`.

For example, if you want the job to be retried five times and gradually
increase the interval based on failed times, you can write logic like
increase the minimal interval based on failed times, you can write logic like
the following:

defmodule HttpSyncJob do
Expand Down