Skip to content

Commit 1e3b63d

Browse files
committed
Catch concurrent future cancelled exception instead of asyncio
1 parent 3dda9c9 commit 1e3b63d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llmstack/play/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import re
44
import threading
5+
from concurrent.futures import CancelledError
56
from urllib.parse import quote
67

78
from diff_match_patch import diff_match_patch
@@ -82,8 +83,8 @@ def start_loop(loop):
8283
def _done_callback(future):
8384
try:
8485
future.result()
85-
except asyncio.CancelledError:
86-
pass
86+
except CancelledError:
87+
logger.info("Task cancelled")
8788
except Exception as e:
8889
logger.exception(f"Task failed with error: {e}")
8990
finally:

0 commit comments

Comments
 (0)