Skip to content

Commit

Permalink
Document suspend and resume commands (#2068)
Browse files Browse the repository at this point in the history
* Document suspend and resume commands

* Title case title

* Modify docs
  • Loading branch information
jackkinsella committed May 1, 2024
1 parent fbd9858 commit 0b31edc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,31 @@ To learn about workers, see the [workers][w] documentation.
[w]: {{site.baseurl}}workers/


## Suspending and Resuming

Sometimes you may want to suspend RQ to prevent it from processing new jobs.
A classic example is during the initial phase of a deployment script or in advance
of putting your site into maintenance mode. This is particularly helpful when
you have jobs that are relatively long-running and might otherwise be forcibly
killed during the deploy.

The `suspend` command stops workers on _all_ queues (in a single Redis database)
from picking up new jobs. However currently running jobs will continue until
completion.

```bash
# Suspend indefinitely
rq suspend

# Suspend for a specific duration (in seconds) then automatically
# resume work again.
rq suspend --duration 300

# Resume work again.
rq resume
```


## Considerations for jobs

Technically, you can put any Python function call on a queue, but that does not
Expand Down

0 comments on commit 0b31edc

Please sign in to comment.