Skip to content

Commit 376353c

Browse files
committed
fix(wechat): check abort flag in streaming loop to honor /stop command
1 parent 26257a1 commit 376353c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

frontends/wechatapp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ def _send(show):
393393
try:
394394
done = []; turn = 1
395395
while True:
396-
item = dq.get(timeout=300)
396+
if _task_aborted.get(uid): break
397+
try: item = dq.get(timeout=300)
398+
except queue.Empty: continue
397399
if 'done' in item: break
398400
if item.get('turn', turn) > turn:
399401
outputs = item.get('outputs', [])

0 commit comments

Comments
 (0)