Skip to content

Commit a646e33

Browse files
author
Anton
committed
fix: if instead of while
1 parent 30d527b commit a646e33

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

taskiq/receiver/receiver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,13 @@ async def run_task( # noqa: C901, PLR0912, PLR0915
269269
logger.warning("Timeouts for sync tasks don't work in python well.")
270270

271271
with anyio.fail_after(float(timeout)):
272-
while inspect.isawaitable(target_future):
272+
target_future = await target_future
273+
if inspect.isawaitable(target_future):
273274
target_future = await target_future
274275

275276
else:
276-
while inspect.isawaitable(target_future):
277+
target_future = await target_future
278+
if inspect.isawaitable(target_future):
277279
target_future = await target_future
278280

279281
returned = target_future

0 commit comments

Comments
 (0)