Skip to content

Commit

Permalink
fix: if instead of while
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton committed Jul 19, 2024
1 parent 30d527b commit a646e33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions taskiq/receiver/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,13 @@ async def run_task( # noqa: C901, PLR0912, PLR0915
logger.warning("Timeouts for sync tasks don't work in python well.")

with anyio.fail_after(float(timeout)):
while inspect.isawaitable(target_future):
target_future = await target_future
if inspect.isawaitable(target_future):
target_future = await target_future

else:
while inspect.isawaitable(target_future):
target_future = await target_future
if inspect.isawaitable(target_future):
target_future = await target_future

returned = target_future
Expand Down

0 comments on commit a646e33

Please sign in to comment.