Skip to content

Commit b674457

Browse files
committed
fix: check types
1 parent ae3d3b6 commit b674457

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

taskiq/middlewares/smart_retry_middleware.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ def __init__(
6161
self.max_delay_exponent = max_delay_exponent
6262
self.schedule_source = schedule_source
6363

64+
if schedule_source is not None and not isinstance(
65+
schedule_source,
66+
ScheduleSource,
67+
):
68+
raise TypeError(
69+
"schedule_source must be an instance of ScheduleSource or None",
70+
)
71+
6472
def is_retry_on_error(self, message: TaskiqMessage) -> bool:
6573
"""
6674
Check if retry is enabled for this task.

0 commit comments

Comments
 (0)