-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
356 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# v1.10.0 | ||
|
||
- Add `priority` to the `TaskManager` model. | ||
- TaskManager doesn't reattempt `mark_task_as_pending`, `mark_task_as_paused`, `mark_task_as_cancelled` and `mark_task_as_reversed` tasks anymore. | ||
- `task_manager` command kills `PENDING` tasks before reattempting them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# SPDX-FileCopyrightText: 2024-present jefer94 <[email protected]> | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
__version__ = "1.9.0" | ||
__version__ = "1.10.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from datetime import datetime, timezone | ||
from enum import Enum | ||
|
||
__all__ = ["DuplicationPolicy"] | ||
|
||
|
||
class DuplicationPolicy(Enum): | ||
SKIP = "SKIP" | ||
OVERRIDE = "OVERRIDE" | ||
APPEND = "APPEND" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from celery import current_app | ||
|
||
# `after_task_publish` is available in celery 3.1+ | ||
# for older versions use the deprecated `task_sent` signal | ||
from celery.signals import after_task_publish | ||
|
||
# when using celery versions older than 4.0, use body instead of headers | ||
|
||
|
||
@after_task_publish.connect | ||
def update_sent_state(sender=None, headers=None, **kwargs): | ||
# the task may not exist if sent using `send_task` which | ||
# sends tasks by name, so fall back to the default result backend | ||
# if that is the case. | ||
task = current_app.tasks.get(sender) | ||
backend = task.backend if task else current_app.backend | ||
|
||
backend.store_result(headers["id"], None, "SENT") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.