An async job scheduler for django using redis/valkey brokers
Project description
Django Tasks Scheduler
Documentation can be found in https://django-tasks-scheduler.readthedocs.io/
Usage
- Update
settings.py
to include scheduler configuration:
import os
from typing import Dict
from scheduler.types import SchedulerConfiguration, Broker, QueueConfiguration
INSTALLED_APPS = [
# ...
'scheduler',
# ...
]
SCHEDULER_CONFIG = SchedulerConfiguration(
EXECUTIONS_IN_PAGE=20,
SCHEDULER_INTERVAL=10,
BROKER=Broker.REDIS,
CALLBACK_TIMEOUT=60, # Callback timeout in seconds (success/failure/stopped)
# Default values, can be overriden per task/job
DEFAULT_SUCCESS_TTL=10 * 60, # Time To Live (TTL) in seconds to keep successful job results
DEFAULT_FAILURE_TTL=365 * 24 * 60 * 60, # Time To Live (TTL) in seconds to keep job failure information
DEFAULT_JOB_TTL=10 * 60, # Time To Live (TTL) in seconds to keep job information
DEFAULT_JOB_TIMEOUT=5 * 60, # timeout (seconds) for a job
# General configuration values
DEFAULT_WORKER_TTL=10 * 60, # Time To Live (TTL) in seconds to keep worker information after last heartbeat
DEFAULT_MAINTENANCE_TASK_INTERVAL=10 * 60, # The interval to run maintenance tasks in seconds. 10 minutes.
DEFAULT_JOB_MONITORING_INTERVAL=30, # The interval to monitor jobs in seconds.
SCHEDULER_FALLBACK_PERIOD_SECS=120, # Period (secs) to wait before requiring to reacquire locks
)
SCHEDULER_QUEUES: Dict[str, QueueConfiguration] = {
'default': QueueConfiguration(URL='redis://localhost:6379/0'),
}
- Update
urls.py
to include scheduler urls:
from django.urls import path, include
urlpatterns = [
# ...
path('scheduler/', include('scheduler.urls')),
]
- Run migrations:
python manage.py migrate
- Check out the admin views:
Sponsor
django-tasks-scheduler is developed for free.
You can support this project by becoming a sponsor using this link.
Contributing
Interested in contributing, providing suggestions, or submitting bugs? See guidelines at this link.
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
File details
Details for the file django_tasks_scheduler-4.0.5.tar.gz
.
File metadata
- Download URL: django_tasks_scheduler-4.0.5.tar.gz
- Upload date:
- Size: 80.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
e2503a18f566000918b33f051913ff3b761bcc1e1398171538ab52e1402c7d9f
|
|
MD5 |
3786e94bf36e2a983a7eb27d80a0ea19
|
|
BLAKE2b-256 |
d07ca60d8c8889f48f0039b757021198f2d3053be6fd0d762c252c25e316c921
|
Provenance
The following attestation bundles were made for django_tasks_scheduler-4.0.5.tar.gz
:
Publisher:
publish.yml
on django-commons/django-tasks-scheduler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
django_tasks_scheduler-4.0.5.tar.gz
-
Subject digest:
e2503a18f566000918b33f051913ff3b761bcc1e1398171538ab52e1402c7d9f
- Sigstore transparency entry: 247612357
- Sigstore integration time:
-
Permalink:
django-commons/django-tasks-scheduler@442002121b8f72f9396efa3a0ccae85f082bd4b4
-
Branch / Tag:
refs/tags/v4.0.5
- Owner: https://github.com/django-commons
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@442002121b8f72f9396efa3a0ccae85f082bd4b4
-
Trigger Event:
release
-
Statement type:
File details
Details for the file django_tasks_scheduler-4.0.5-py3-none-any.whl
.
File metadata
- Download URL: django_tasks_scheduler-4.0.5-py3-none-any.whl
- Upload date:
- Size: 135.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
2f7a94b128b769b007e352c2c575efcf15b6b2a52a25f348c1b14d4563ba2d07
|
|
MD5 |
f4c3f60aa14b9dde224f192705edd832
|
|
BLAKE2b-256 |
7dd0d2e9693359d129b2685ba4130e3f1d31c8b8fb1ef389f7d18e81ca45ffcb
|
Provenance
The following attestation bundles were made for django_tasks_scheduler-4.0.5-py3-none-any.whl
:
Publisher:
publish.yml
on django-commons/django-tasks-scheduler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
django_tasks_scheduler-4.0.5-py3-none-any.whl
-
Subject digest:
2f7a94b128b769b007e352c2c575efcf15b6b2a52a25f348c1b14d4563ba2d07
- Sigstore transparency entry: 247612378
- Sigstore integration time:
-
Permalink:
django-commons/django-tasks-scheduler@442002121b8f72f9396efa3a0ccae85f082bd4b4
-
Branch / Tag:
refs/tags/v4.0.5
- Owner: https://github.com/django-commons
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@442002121b8f72f9396efa3a0ccae85f082bd4b4
-
Trigger Event:
release
-
Statement type: