Skip to content

Commit 7400200

Browse files
committed
fixes on canceling
1 parent cc1ffe1 commit 7400200

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/common-library/src/common_library/async_tools.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ async def cancel_wait_task(
9090
CancelledError: raised ONLY if owner is being cancelled.
9191
"""
9292

93-
task.cancel()
93+
cancelling = task.cancel()
94+
if not cancelling:
95+
return # task was alredy cancelled
96+
9497
assert task.cancelling() # nosec
9598
assert not task.cancelled() # nosec
9699

0 commit comments

Comments
 (0)