MCPcopy
hub / github.com/alexta69/metube / start_background_loop

Method start_background_loop

app/subscriptions.py:436–444  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

434 return self._subs.get(sub_id)
435
436 def start_background_loop(self) -> None:
437 if self._loop_task is not None and not self._loop_task.done():
438 return
439 self._loop_task = asyncio.create_task(self._periodic_loop())
440 self._loop_task.add_done_callback(
441 lambda t: log.error("Subscription loop failed: %s", t.exception())
442 if not t.cancelled() and t.exception()
443 else None
444 )
445
446 async def _periodic_loop(self) -> None:
447 while True:

Callers 1

Calls 3

_periodic_loopMethod · 0.95
doneMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected