Skip to content

Commit 0bae760

Browse files
committed
Documentation for the retry_failed_job api
1 parent f496bab commit 0bae760

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/howto/advanced.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ advanced/cancellation
1212
advanced/queueing_locks
1313
advanced/cron
1414
advanced/retry
15+
advanced/retry_failed
1516
advanced/middleware
1617
advanced/events
1718
advanced/sync_defer

docs/howto/advanced/retry_failed.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Retry a Failed Job Manually
2+
3+
Sometimes a manual retry, for instance, after we fix an integration's configuration, can be practical.
4+
This is why the job_manager offers an API to do so. Retrying a `failed` job will set the status of the job
5+
back to `todo` while keeping the history of events in place. The action of retrying a failed job,
6+
is also recording a new Event of type `retried`.
7+
8+
:warning: if the job is not `failed`, the method will raise an error.
9+
10+
## Retry a failed job programatically
11+
12+
```python
13+
app.job_manager.retry_failed_job_by_id(
14+
job.id, job.priority, job.queue_name, job.lock
15+
)
16+
# or by using the async method
17+
await app.job_manager.retry_failed_job_by_id_async(
18+
job.id, job.priority, job.queue_name, job.lock
19+
)
20+
```
21+
22+
## For django users
23+
24+
An admin action `Retry Failed Job` can also be invoked from the table view of the
25+
Procrastinate Jobs.

0 commit comments

Comments
 (0)