收窄熔断判断范围,修改熔断逻辑 (#2145)

This commit is contained in:
Copaan
2026-06-28 22:12:07 +08:00
committed by GitHub
parent f4d2342693
commit bdc1374848
6 changed files with 59 additions and 14 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ import time
from typing import Any
from zhenxun.services.log import logger
from zhenxun.services.message_load import should_pause_tasks, signal_db_unhealthy
from zhenxun.services.message_load import should_pause_db_tasks, signal_db_unhealthy
from zhenxun.utils.manager.priority_manager import PriorityLifecycle
LOG_COMMAND = "LowPriorityWriter"
@@ -159,7 +159,7 @@ async def _worker_loop() -> None:
except asyncio.TimeoutError:
pass
event.clear()
if should_pause_tasks():
if should_pause_db_tasks():
continue
async with _FLUSH_LOCK:
for state in list(_WRITERS.values()):
@@ -186,7 +186,7 @@ async def _flush_state(
force: bool = False,
) -> int:
if not force:
if should_pause_tasks():
if should_pause_db_tasks():
return 0
if time.monotonic() < state.backoff_until:
return 0