Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Include new arg in readme documentation
  • Loading branch information
George9Waller committed Feb 21, 2025
commit 73228276f58dcd4502503a2255a4580828eb0ab2
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ queue_depths = Job.get_queue_depths()
print(queue_depths) # {"default": 1, "other_queue": 1}
```

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:
```python
queue_depths = Job.get_queue_depths(exclude_future_jobs=True)
```

**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
in the dict returned by this method.

Expand All @@ -312,6 +317,8 @@ manage.py worker [queue_name] [--rate_limit]
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
jobs in the "NEW" or "READY" states will be returned.

If you wish to exclude jobs which are scheduled to be run in the future you can add `--exclude_future_jobs` to the command.

**Important:** If you misspell or provide a queue name which does not have any jobs, a depth of 0 will always be returned.

### Gotcha: `bulk_create`
Expand Down
Loading