An administrative interface for managing RQ tasks in Paper Admin
Project description
paper-rq
An administrative interface for managing RQ tasks in Paper Admin.
⚠ Default rq.scheduler is not supported! Use rq-scheduler instead.
Compatibility
paper-admin>= 6.0django-rq>= 2.4python>= 3.7
Installation
Install the latest release with pip:
pip install paper-rq
Add paper_rq to your INSTALLED_APPS in django's settings.py:
INSTALLED_APPS = (
# ...
"paper_rq",
)
Add paper_rq to your PAPER_MENU:
from paper_admin.menu import Item
PAPER_MENU = [
# ...
Item(
app="paper_rq",
icon="bi-clock-history",
),
# ...
]
Result
job decorator
The same as RQ's job decorator, but it automatically works out
the connection argument from RQ_QUEUES. It also respects the
RQ.DEFAULT_RESULT_TTL and RQ.DEFAULT_FAILURE_TTL settings.
Example:
import time
from paper_rq.decorators import job
@job("paper:default")
def sleep(delay):
time.sleep(delay)
sleep.delay(5)
RQ Scheduler
First, ensure that you have the rq-scheduler library installed:
pip install rq-scheduler
If you need to run multiple isolated schedulers on the same server, you should
use the class paper_rq.scheduler.Scheduler. This class reads the Redis keys
from the RQ settings:
# settings.py
RQ = {
"DEFAULT_RESULT_TTL": "7d",
"DEFAULT_FAILURE_TTL": "30d",
"SCHEDULER_CLASS": "paper_rq.scheduler.Scheduler",
"SCHEDULER_LOCK_KEY": "rq:scheduler-1:scheduler_lock",
"SCHEDULER_JOBS_KEY": "rq:scheduler-1:scheduled_jobs",
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paper-rq-0.7.2.tar.gz.
File metadata
- Download URL: paper-rq-0.7.2.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f59b73199dff8b808c08b99577525279d30c93c3388e3c3f09d6741d3aad62d
|
|
| MD5 |
a3bc8af9eca2437f698fcb842b98c4f6
|
|
| BLAKE2b-256 |
67d7126623cb98d7b8dc0189fc47a48c3c739b923118344ea64a73c2f37452fa
|
File details
Details for the file paper_rq-0.7.2-py2.py3-none-any.whl.
File metadata
- Download URL: paper_rq-0.7.2-py2.py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba7961f7d8cfeaec6364590fd2d09f3a8d74c2d913e4f141e670cf3833b95544
|
|
| MD5 |
fa7d26d959e6c071540bb9a38b0126f1
|
|
| BLAKE2b-256 |
8149fc420bcf3303ec50aba815c141fa5cde893637324f64c3fad960d89c919f
|