Skip to content

Commit 7322827

Browse files
committed
Include new arg in readme documentation
1 parent 738be6d commit 7322827

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ queue_depths = Job.get_queue_depths()
288288
print(queue_depths) # {"default": 1, "other_queue": 1}
289289
```
290290

291+
You can also exclude jobs which exist but are scheduled to be run in the future from the queue depths, where `run_after` is set to a future time from now. To do this set the `exclude_future_jobs` kwarg like so:
292+
```python
293+
queue_depths = Job.get_queue_depths(exclude_future_jobs=True)
294+
```
295+
291296
**Important:** When checking queue depths, do not assume that the key for your queue will always be available. Queue depths of zero won't be included
292297
in the dict returned by this method.
293298

@@ -312,6 +317,8 @@ manage.py worker [queue_name] [--rate_limit]
312317
If you'd like to check your queue depth from the command line, you can run `manage.py queue_depth [queue_name [queue_name ...]]` and any
313318
jobs in the "NEW" or "READY" states will be returned.
314319

320+
If you wish to exclude jobs which are scheduled to be run in the future you can add `--exclude_future_jobs` to the command.
321+
315322
**Important:** If you misspell or provide a queue name which does not have any jobs, a depth of 0 will always be returned.
316323

317324
### Gotcha: `bulk_create`

0 commit comments

Comments
 (0)