sync update from LAN repo (source dhk-1 @ 3e87be55)

This commit is contained in:
gozeros committed 2026-10-21 15:06:08 +08:00
1 parent ab6068a7c1
commit 42f2a26fa8
1482 files changed
+227759 -9584

No files matched your search

@@ -51,6 +51,19 @@ class DeepResearchJobDispatcher:
self._task = asyncio.create_task(self._loop(), name="deep-research-job-dispatcher")
logger.info("[deep-research] dispatcher started (worker=%s)", self._worker_id)
def ensure_started(self) -> bool:
"""Restart the loop if it died after lifespan. Returns True if a new loop started."""
if self._stopping:
return False
if self._task is not None and not self._task.done():
return False
logger.warning(
"[deep-research] dispatcher loop was not running; restarting (worker=%s)",
self._worker_id,
)
self.start()
return True
async def stop(self) -> None:
"""Stop the background loop (called from lifespan shutdown)."""
self._stopping = True