feat: 适当扩大历史日志的容量 (#602)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2026-01-11 21:42:31 +08:00
committed by GitHub
parent 26514f7174
commit f122b9756b
2 changed files with 2 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ use parking_lot::RwLock;
use tokio::sync::broadcast;
use tracing_subscriber::fmt::MakeWriter;
pub const MAX_HISTORY_LOGS: usize = 30;
pub const MAX_HISTORY_LOGS: usize = 200;
/// LogHelper 维护了日志发送器和一个日志历史记录的缓冲区
pub struct LogHelper {

View File

@@ -27,7 +27,7 @@
main = document.getElementById('main');
main?.addEventListener('scroll', checkScrollPosition);
unsubscribeLog = api.subscribeToLogs((data: string) => {
logs = [...logs.slice(-200), JSON.parse(data)];
logs = [...logs.slice(-499), JSON.parse(data)];
setTimeout(scrollToBottom, 0);
});
return () => {