no commit message
This commit is contained in:
@@ -40,7 +40,7 @@ socket.on('connect_timeout', () => {
|
|||||||
// 定时轮询定时器
|
// 定时轮询定时器
|
||||||
let pollingTimer = null
|
let pollingTimer = null
|
||||||
|
|
||||||
// 启动定时轮询(每10秒)
|
// 启动定时轮询(每30秒)
|
||||||
function startPolling() {
|
function startPolling() {
|
||||||
if (pollingTimer) {
|
if (pollingTimer) {
|
||||||
clearInterval(pollingTimer)
|
clearInterval(pollingTimer)
|
||||||
@@ -48,8 +48,8 @@ function startPolling() {
|
|||||||
pollingTimer = setInterval(() => {
|
pollingTimer = setInterval(() => {
|
||||||
// 触发刷新事件,让客户端主动获取最新数据
|
// 触发刷新事件,让客户端主动获取最新数据
|
||||||
socket.emit('refreshAllCounts')
|
socket.emit('refreshAllCounts')
|
||||||
}, 10000) // 每10秒刷新一次
|
}, 30000) // 每30秒刷新一次
|
||||||
console.log('定时轮询已启动,每5秒刷新一次')
|
console.log('定时轮询已启动,每30秒刷新一次')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止定时轮询
|
// 停止定时轮询
|
||||||
|
|||||||
Reference in New Issue
Block a user