MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / clear_stream_queue

Function clear_stream_queue

api_utils/utils_ext/stream.py:467–487  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

465
466
467async def clear_stream_queue():
468 import queue
469
470 from api_utils.server_state import state
471
472 STREAM_QUEUE = state.STREAM_QUEUE
473 logger = state.logger
474
475 if STREAM_QUEUE is None:
476 return
477 cleared_count = 0
478 while True:
479 try:
480 await asyncio.to_thread(STREAM_QUEUE.get_nowait)
481 cleared_count += 1
482 except queue.Empty:
483 break
484 except Exception:
485 break
486 if cleared_count > 0:
487 logger.info(f"Stream queue cleared. Items: {cleared_count}")
488
489
490async def detect_function_calls_from_dom(

Calls 1

infoMethod · 0.80