Skip to content

Commit 54bec4a

Browse files
SARomanchukSARomanchuk
authored andcommitted
issue:493
add: task_id for retry scheduled task
1 parent 0f69945 commit 54bec4a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

taskiq/kicker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ def with_labels(
6969
self.labels.update(labels)
7070
return self
7171

72-
def with_task_id(self, task_id: str) -> "AsyncKicker[_FuncParams, _ReturnType]":
72+
def with_task_id(
73+
self,
74+
task_id: Optional[str],
75+
) -> "AsyncKicker[_FuncParams, _ReturnType]":
7376
"""
7477
Set task_id for current execution.
7578

taskiq/scheduler/scheduler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ async def on_ready(self, source: "ScheduleSource", task: ScheduledTask) -> None:
5151
.with_labels(
5252
schedule_id=task.schedule_id,
5353
)
54+
.with_task_id(task_id=task.task_id)
5455
.kiq(
5556
*task.args,
5657
**task.kwargs,

0 commit comments

Comments
 (0)