whois
This commit is contained in:
@@ -129,8 +129,13 @@ function setupReconnect() {
|
||||
}, reconnectDelay);
|
||||
}
|
||||
|
||||
// 处理实时数据更新 - 添加节流机制
|
||||
// 处理实时数据更新 - 添加节流机制和页面可见性检查
|
||||
function processRealTimeData(stats) {
|
||||
// 页面不可见时跳过处理,节省资源
|
||||
if (document.hidden) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 节流处理,限制执行频率
|
||||
const now = Date.now();
|
||||
if (now - lastProcessedTime < PROCESS_THROTTLE_INTERVAL) {
|
||||
@@ -140,7 +145,7 @@ function processRealTimeData(stats) {
|
||||
|
||||
try {
|
||||
|
||||
// 确保stats是有效的对象
|
||||
// 确保 stats 是有效的对象
|
||||
if (!stats || typeof stats !== 'object') {
|
||||
console.error('无效的实时数据:', stats);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user