perf: 优化日志流发送频率,防止积压超过 buffer size 导致前端显示异常

This commit is contained in:
Soulter
2025-05-31 11:25:51 +08:00
parent 907801605c
commit 20d2e5c578
+1
View File
@@ -23,6 +23,7 @@ class LogRoute(Route):
**message, # see astrbot/core/log.py
}
yield f"data: {json.dumps(payload, ensure_ascii=False)}\n\n"
await asyncio.sleep(0.07) # 控制发送频率,避免过快
except asyncio.CancelledError:
pass
except BaseException as e: