MCPcopy Create free account
hub / github.com/IBM/mcp-cli / _stop_refresh_loop

Method _stop_refresh_loop

src/mcp_cli/display/manager.py:345–362  ·  view source on GitHub ↗

Stop background refresh loop.

(self)

Source from the content-addressed store, hash-verified

343 logger.debug("Started refresh loop")
344
345 async def _stop_refresh_loop(self) -> None:
346 """Stop background refresh loop."""
347 from mcp_cli.config import REFRESH_TIMEOUT
348
349 self._refresh_active = False
350
351 if self._refresh_task and not self._refresh_task.done():
352 try:
353 await asyncio.wait_for(self._refresh_task, timeout=REFRESH_TIMEOUT)
354 except asyncio.TimeoutError:
355 self._refresh_task.cancel()
356 try:
357 await self._refresh_task
358 except asyncio.CancelledError:
359 pass
360
361 self._refresh_task = None
362 logger.debug("Stopped refresh loop")
363
364 async def _refresh_loop(self) -> None:
365 """Background loop that refreshes the display.

Callers 3

stop_streamingMethod · 0.95
stop_tool_executionMethod · 0.95

Calls

no outgoing calls

Tested by 1