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
Hashes for paper_rq-0.7.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c980c835be94ccd05d32e91c592428370ca27b6d68d4373e207a4d510fd7b47c |
|
MD5 | 23e3c11a6fc41701d64c522318e82ee5 |
|
BLAKE2b-256 | b32c4c5b48f97441ddd15fb8c89b1fe1b6877a974cb7b8b8fe8e2c906ccba9e5 |