Skip to content

Commit 3b20065

Browse files
authored
fix: check readiness before timeout
I think that when a task completes as the timeout expire, the code should return the result rather than raise.
1 parent 3770e73 commit 3b20065

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

taskiq/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ async def wait_result(
9898
"""
9999
start_time = time()
100100
while not await self.is_ready():
101-
await asyncio.sleep(check_interval)
102101
if 0 < timeout < time() - start_time:
103102
raise TaskiqResultTimeoutError(timeout=timeout)
103+
await asyncio.sleep(check_interval)
104104
return await self.get_result(with_logs=with_logs)
105105

106106
async def get_progress(self) -> "TaskProgress[Any] | None":

0 commit comments

Comments
 (0)