mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
Fix usage logging dedupe and reduce stats churn
- batch console log buffer events and support batched SSE log messages - debounce usage stats update/pending events to reduce UI/runtime churn - avoid awaiting request-success bookkeeping before returning provider responses - deduplicate identical usage writes in usageHistory/daily aggregates - reduce default logger verbosity from DEBUG to INFO (overridable via LOG_LEVEL) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
ec096d2add
commit
0d21668917
@@ -47,6 +47,11 @@ export default function ConsoleLogClient() {
|
||||
const next = [...prev, msg.line];
|
||||
return next.length > CONSOLE_LOG_CONFIG.maxLines ? next.slice(-CONSOLE_LOG_CONFIG.maxLines) : next;
|
||||
});
|
||||
} else if (msg.type === "lines") {
|
||||
setLogs((prev) => {
|
||||
const next = [...prev, ...msg.lines];
|
||||
return next.length > CONSOLE_LOG_CONFIG.maxLines ? next.slice(-CONSOLE_LOG_CONFIG.maxLines) : next;
|
||||
});
|
||||
} else if (msg.type === "clear") {
|
||||
setLogs([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user