mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-07-07 23:51:47 +08:00
feat: 适当扩大历史日志的容量 (#602)
This commit is contained in:
@@ -5,7 +5,7 @@ use parking_lot::RwLock;
|
|||||||
use tokio::sync::broadcast;
|
use tokio::sync::broadcast;
|
||||||
use tracing_subscriber::fmt::MakeWriter;
|
use tracing_subscriber::fmt::MakeWriter;
|
||||||
|
|
||||||
pub const MAX_HISTORY_LOGS: usize = 30;
|
pub const MAX_HISTORY_LOGS: usize = 200;
|
||||||
|
|
||||||
/// LogHelper 维护了日志发送器和一个日志历史记录的缓冲区
|
/// LogHelper 维护了日志发送器和一个日志历史记录的缓冲区
|
||||||
pub struct LogHelper {
|
pub struct LogHelper {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
main = document.getElementById('main');
|
main = document.getElementById('main');
|
||||||
main?.addEventListener('scroll', checkScrollPosition);
|
main?.addEventListener('scroll', checkScrollPosition);
|
||||||
unsubscribeLog = api.subscribeToLogs((data: string) => {
|
unsubscribeLog = api.subscribeToLogs((data: string) => {
|
||||||
logs = [...logs.slice(-200), JSON.parse(data)];
|
logs = [...logs.slice(-499), JSON.parse(data)];
|
||||||
setTimeout(scrollToBottom, 0);
|
setTimeout(scrollToBottom, 0);
|
||||||
});
|
});
|
||||||
return () => {
|
return () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user