taskferry-celery 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/CHANGELOG.md +8 -0
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/PKG-INFO +1 -1
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/pyproject.toml +1 -1
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/src/taskferry_celery/__init__.py +1 -1
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/src/taskferry_celery/backend.py +2 -1
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/src/taskferry_celery/worker.py +11 -3
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/.gitignore +0 -0
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/LICENSE +0 -0
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/README.md +0 -0
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/src/taskferry_celery/message.py +0 -0
- {taskferry_celery-0.2.0 → taskferry_celery-0.2.1}/src/taskferry_celery/py.typed +0 -0
|
@@ -5,6 +5,14 @@ rest of the family.
|
|
|
5
5
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
|
+
## [0.2.1] — 2026-11-27
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Propagate Celery's current retry number and worker hostname into execution
|
|
13
|
+
context for adapters such as `taskferry-django`.
|
|
14
|
+
- Align `taskferry_celery.__version__` with the distribution version `0.2.1`.
|
|
15
|
+
|
|
8
16
|
## [0.2.0] — 2026-11-26
|
|
9
17
|
|
|
10
18
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: taskferry-celery
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Celery task backend for Taskferry — enqueue Taskferry tasks onto a Celery app.
|
|
5
5
|
Project-URL: Homepage, https://github.com/xiidigital/taskferry
|
|
6
6
|
Project-URL: Documentation, https://taskferry.dev
|
|
@@ -71,6 +71,7 @@ CELERY_CAPABILITIES = frozenset(
|
|
|
71
71
|
Capability.DELAY,
|
|
72
72
|
Capability.PRIORITY,
|
|
73
73
|
Capability.RETRY,
|
|
74
|
+
Capability.EXECUTION_CONTEXT,
|
|
74
75
|
}
|
|
75
76
|
)
|
|
76
77
|
|
|
@@ -207,7 +208,7 @@ class CeleryTaskBackend(BaseBackend):
|
|
|
207
208
|
) from exc
|
|
208
209
|
|
|
209
210
|
task_id = str(getattr(async_result, "id", "") or "")
|
|
210
|
-
execution_id = new_execution_id(ExecutionKind.TASK)
|
|
211
|
+
execution_id = spec.execution_id or new_execution_id(ExecutionKind.TASK)
|
|
211
212
|
self._ids.remember(str(execution_id), task_id)
|
|
212
213
|
return Execution(
|
|
213
214
|
id=execution_id,
|
|
@@ -58,10 +58,12 @@ def execute_message(
|
|
|
58
58
|
message: TaskferryMessage,
|
|
59
59
|
*,
|
|
60
60
|
registry: FunctionRegistry | None = None,
|
|
61
|
+
attempt: int | None = None,
|
|
62
|
+
worker_id: str | None = None,
|
|
61
63
|
) -> Any:
|
|
62
64
|
"""Resolve and run one Taskferry message. Pure of Celery, so unit-testable."""
|
|
63
65
|
check_version(message)
|
|
64
|
-
return execute_envelope(message, registry=registry)
|
|
66
|
+
return execute_envelope(message, registry=registry, attempt=attempt, worker_id=worker_id)
|
|
65
67
|
|
|
66
68
|
|
|
67
69
|
def register_dispatcher(
|
|
@@ -97,10 +99,16 @@ def register_dispatcher(
|
|
|
97
99
|
@app.task(name=name, **task_options) # type: ignore[untyped-decorator]
|
|
98
100
|
def _taskferry_dispatch(self: Any, message: TaskferryMessage) -> Any:
|
|
99
101
|
policy = decode_retry(message)
|
|
102
|
+
request = getattr(self, "request", None)
|
|
103
|
+
attempt = int(getattr(request, "retries", 0) or 0) + 1
|
|
100
104
|
try:
|
|
101
|
-
return execute_message(
|
|
105
|
+
return execute_message(
|
|
106
|
+
message,
|
|
107
|
+
registry=registry,
|
|
108
|
+
attempt=attempt,
|
|
109
|
+
worker_id=getattr(request, "hostname", None),
|
|
110
|
+
)
|
|
102
111
|
except Exception as exc:
|
|
103
|
-
attempt = int(getattr(getattr(self, "request", None), "retries", 0) or 0) + 1
|
|
104
112
|
if policy.should_retry(exc, attempt):
|
|
105
113
|
# Celery owns the retry — a real re-queue with a real countdown —
|
|
106
114
|
# rather than this function looping and holding a worker slot.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|