mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 21:47:53 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7add68f770 | ||
|
|
782b1de60d | ||
|
|
88430c9014 | ||
|
|
6265a54008 | ||
|
|
1b638e5802 | ||
|
|
13a382cca2 | ||
|
|
098aa66a2d | ||
|
|
b3f494571f | ||
|
|
503127233f |
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -11,15 +11,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
python-version: 3.11
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -85,7 +85,7 @@ jobs:
|
||||
finish:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
container: python:3-slim
|
||||
container: python:3.11-bookworm
|
||||
steps:
|
||||
- name: Upload to coveralls
|
||||
run: |
|
||||
|
||||
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,5 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
## [v1.6.2](https://github.com/django-q2/django-q2/tree/v1.6.2) (2024-03-05)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Allow different broker on chain https://github.com/django-q2/django-q2/pull/156
|
||||
- Fix formatting issues in README.rst https://github.com/django-q2/django-q2/pull/159
|
||||
- Update docs to add cluster option to the async_task https://github.com/django-q2/django-q2/pull/157
|
||||
- Update release/test dependencies https://github.com/django-q2/django-q2/pull/147
|
||||
- Fix for Negative Repeat Count in Scheduler https://github.com/django-q2/django-q2/pull/146
|
||||
- Update django.po https://github.com/django-q2/django-q2/pull/138
|
||||
- Use importerror for b62_decode and avoid deprecation notification https://github.com/django-q2/django-q2/pull/134
|
||||
- Specify build system in pyproject.toml https://github.com/django-q2/django-q2/pull/131
|
||||
|
||||
## [v1.6.1](https://github.com/django-q2/django-q2/tree/v1.6.1) (2023-10-13)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
12
README.rst
12
README.rst
@@ -3,9 +3,7 @@ A multiprocessing distributed task queue for Django
|
||||
|
||||
|image0| |image1| |docs| |downloads|
|
||||
|
||||
::
|
||||
|
||||
Django Q2 is a fork of Django Q. Big thanks to Ilan Steemers for starting this project. Unfortunately, development has stalled since June 2021. Django Q2 is the new updated version of Django Q, with dependencies updates, docs updates and several bug fixes. Original repository: https://github.com/Koed00/django-q
|
||||
Django Q2 is a fork of Django Q. Big thanks to Ilan Steemers for starting this project. Unfortunately, development has stalled since June 2021. Django Q2 is the new updated version of Django Q, with dependencies updates, docs updates and several bug fixes. Original repository: https://github.com/Koed00/django-q
|
||||
|
||||
Features
|
||||
~~~~~~~~
|
||||
@@ -73,7 +71,6 @@ Installation
|
||||
|
||||
Read the full documentation at `https://django-q2.readthedocs.org <https://django-q2.readthedocs.org>`__
|
||||
|
||||
|
||||
Configuration
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
@@ -104,10 +101,7 @@ For full configuration options, see the `configuration documentation <https://dj
|
||||
Management Commands
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
For the management commands to work, you will need to install Blessed: <https://github.com/jquast/blessed>
|
||||
|
||||
For the management commands to work, you will need to install Blessed: <https://github.com/jquast/blessed>
|
||||
|
||||
Start a cluster with::
|
||||
|
||||
@@ -159,7 +153,6 @@ Use `async_task` from your code to quickly offload tasks:
|
||||
|
||||
For more info see `Tasks <https://django-q2.readthedocs.org/en/latest/tasks.html>`__
|
||||
|
||||
|
||||
Schedule
|
||||
~~~~~~~~
|
||||
|
||||
@@ -204,7 +197,6 @@ Admin page or directly from your code:
|
||||
|
||||
For more info check the `Schedules <https://django-q2.readthedocs.org/en/latest/schedules.html>`__ documentation.
|
||||
|
||||
|
||||
Testing
|
||||
~~~~~~~
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import django
|
||||
|
||||
VERSION = (1, 6, 1)
|
||||
VERSION = (1, 6, 2)
|
||||
|
||||
if django.VERSION < (3, 2):
|
||||
default_app_config = "django_q.apps.DjangoQConfig"
|
||||
|
||||
@@ -8,11 +8,12 @@ from django.core.signing import Signer as Sgnr
|
||||
from django.core.signing import TimestampSigner as TsS
|
||||
from django.core.signing import b64_decode, dumps
|
||||
|
||||
if django.VERSION < (5, 0):
|
||||
try:
|
||||
from django.core.signing import b62_decode
|
||||
except ImportError:
|
||||
# fallback for django 3.x
|
||||
from django.utils.baseconv import base62
|
||||
b62_decode = base62.decode
|
||||
else:
|
||||
from django.core.signing import b62_decode
|
||||
|
||||
from django.utils.crypto import constant_time_compare
|
||||
from django.utils.encoding import force_bytes, force_str
|
||||
|
||||
@@ -303,7 +303,7 @@ msgstr "Bimestriel"
|
||||
|
||||
#: models.py:194
|
||||
msgid "Quarterly"
|
||||
msgstr "Tous les quart-d’heure"
|
||||
msgstr "Trimestriel"
|
||||
|
||||
#: models.py:195
|
||||
msgid "Yearly"
|
||||
|
||||
@@ -82,7 +82,15 @@ def scheduler(broker: Broker = None):
|
||||
break
|
||||
|
||||
s.next_run = next_run
|
||||
s.repeats += -1
|
||||
|
||||
# Little Fix for already broken numbers
|
||||
if s.repeats < -1:
|
||||
s.repeats = -1
|
||||
|
||||
# Check if the value is not zero
|
||||
if s.repeats > 0:
|
||||
s.repeats -= 1
|
||||
|
||||
# send it to the cluster; any cluster name is allowed in multi-queue scenarios
|
||||
# because `broker_name` is confusing, using `cluster` name is recommended and takes precedence
|
||||
q_options["cluster"] = s.cluster or q_options.get(
|
||||
|
||||
@@ -569,10 +569,10 @@ class Chain:
|
||||
A sequential chain of tasks
|
||||
"""
|
||||
|
||||
def __init__(self, chain=None, group=None, cached=Conf.CACHED, sync=Conf.SYNC):
|
||||
def __init__(self, chain=None, group=None, cached=Conf.CACHED, sync=Conf.SYNC, broker=None):
|
||||
self.chain = chain or []
|
||||
self.group = group or ""
|
||||
self.broker = get_broker()
|
||||
self.broker = broker or get_broker()
|
||||
self.cached = cached
|
||||
self.sync = sync
|
||||
self.started = False
|
||||
|
||||
@@ -49,8 +49,9 @@ Reference
|
||||
:param str group: an optional group name.
|
||||
:param bool cached: run this against the cache backend
|
||||
:param bool sync: execute this inline instead of asynchronous
|
||||
:param broker: an optional broker instance
|
||||
|
||||
.. py:class:: Chain(chain=None, group=None, cached=Conf.CACHED, sync=Conf.SYNC)
|
||||
.. py:class:: Chain(chain=None, group=None, cached=Conf.CACHED, sync=Conf.SYNC, broker=None)
|
||||
|
||||
A sequential chain of tasks. Acts as a convenient wrapper for :func:`async_chain`
|
||||
You can pass the task chain at construction or you can append individual tasks before running them.
|
||||
@@ -59,6 +60,8 @@ Reference
|
||||
:param str group: an optional group name.
|
||||
:param bool cached: run this against the cache backend
|
||||
:param bool sync: execute this inline instead of asynchronous
|
||||
:param bool sync: execute this inline instead of asynchronous
|
||||
:param broker: an optional broker instance
|
||||
|
||||
|
||||
.. py:method:: append(func, *args, **kwargs)
|
||||
|
||||
@@ -75,7 +75,7 @@ author = "Ilan Steemers, Stan Triepels"
|
||||
# The short X.Y version.
|
||||
version = "1.6"
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = "1.6.1"
|
||||
release = "1.6.2"
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -75,6 +75,10 @@ broker
|
||||
""""""
|
||||
A broker instance, in case you want to control your own connections.
|
||||
|
||||
cluster
|
||||
""""""
|
||||
The name of the cluster. Only useful if you are using [alternative queues](https://django-q2.readthedocs.io/en/master/cluster.html#multiple-queues).
|
||||
|
||||
task_name
|
||||
"""""""""
|
||||
|
||||
@@ -241,7 +245,7 @@ Reference
|
||||
---------
|
||||
|
||||
.. py:function:: async_task(func, *args, hook=None, group=None, timeout=None,\
|
||||
save=None, sync=False, cached=False, broker=None, q_options=None, **kwargs)
|
||||
save=None, sync=False, cached=False, broker=None, cluster=None, q_options=None, **kwargs)
|
||||
|
||||
Puts a task in the cluster queue
|
||||
|
||||
@@ -255,6 +259,7 @@ Reference
|
||||
:param bool sync: If set to True, async_task will simulate a task execution
|
||||
:param cached: Output the result to the cache backend. Bool or timeout in seconds
|
||||
:param broker: Optional broker connection from :func:`brokers.get_broker`
|
||||
:param cluster: Optional cluster name if using alternative queues
|
||||
:param dict q_options: Options dict, overrides option keywords
|
||||
:param dict kwargs: Keyword arguments for the task function
|
||||
:returns: The uuid of the task
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
name = "django-q2"
|
||||
version = "1.6.1"
|
||||
version = "1.6.2"
|
||||
packages = [
|
||||
{ include = "django_q" },
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user