MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / stop_protocol_refresher

Method stop_protocol_refresher

src/services/token_manager.py:907–918  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

905 self._protocol_refresher_task = asyncio.create_task(self._protocol_refresh_loop())
906
907 async def stop_protocol_refresher(self) -> None:
908 task = self._protocol_refresher_task
909 self._protocol_refresher_task = None
910 if not task or task.done():
911 return
912 task.cancel()
913 try:
914 await task
915 except asyncio.CancelledError:
916 pass
917 except Exception as e:
918 debug_logger.log_warning(f"[PROTOCOL_REFRESH] 停止后台任务时出错: {e}")
919
920 async def ensure_project_exists(self, token_id: int) -> str:
921 """Ensure a token has a pooled set of projects and return one in round-robin order."""

Callers 1

lifespanFunction · 0.80

Calls 3

doneMethod · 0.80
cancelMethod · 0.80
log_warningMethod · 0.80

Tested by

no test coverage detected