Showing
1 changed file
with
14 additions
and
0 deletions
| @@ -4208,6 +4208,7 @@ | @@ -4208,6 +4208,7 @@ | ||
| 4208 | let reportTaskId = null; | 4208 | let reportTaskId = null; |
| 4209 | let reportPollingInterval = null; | 4209 | let reportPollingInterval = null; |
| 4210 | let reportEventSource = null; | 4210 | let reportEventSource = null; |
| 4211 | + let reportLogRefreshInterval = null; // 日志刷新定时器 | ||
| 4211 | let reportAutoPreviewLoaded = false; | 4212 | let reportAutoPreviewLoaded = false; |
| 4212 | let reportStreamReconnectTimer = null; | 4213 | let reportStreamReconnectTimer = null; |
| 4213 | let reportStreamRetryDelay = 3000; | 4214 | let reportStreamRetryDelay = 3000; |
| @@ -4920,6 +4921,14 @@ | @@ -4920,6 +4921,14 @@ | ||
| 4920 | updateReportStreamStatus('connected'); | 4921 | updateReportStreamStatus('connected'); |
| 4921 | appendReportStreamLine(isRetry ? 'SSE重连成功' : 'Report Engine流式连接已建立', 'success', { badge: 'SSE' }); | 4922 | appendReportStreamLine(isRetry ? 'SSE重连成功' : 'Report Engine流式连接已建立', 'success', { badge: 'SSE' }); |
| 4922 | startStreamHeartbeat(); | 4923 | startStreamHeartbeat(); |
| 4924 | + | ||
| 4925 | + // 启动日志刷新定时器,每1秒刷新一次日志 | ||
| 4926 | + if (reportLogRefreshInterval) { | ||
| 4927 | + clearInterval(reportLogRefreshInterval); | ||
| 4928 | + } | ||
| 4929 | + reportLogRefreshInterval = setInterval(() => { | ||
| 4930 | + refreshReportLog(); | ||
| 4931 | + }, 1000); // 每1秒刷新一次 | ||
| 4923 | }; | 4932 | }; |
| 4924 | reportEventSource.onerror = () => { | 4933 | reportEventSource.onerror = () => { |
| 4925 | appendReportStreamLine('检测到网络抖动,SSE正在等待自动重连...', 'warn', { badge: 'SSE' }); | 4934 | appendReportStreamLine('检测到网络抖动,SSE正在等待自动重连...', 'warn', { badge: 'SSE' }); |
| @@ -4946,6 +4955,11 @@ | @@ -4946,6 +4955,11 @@ | ||
| 4946 | clearTimeout(reportStreamReconnectTimer); | 4955 | clearTimeout(reportStreamReconnectTimer); |
| 4947 | reportStreamReconnectTimer = null; | 4956 | reportStreamReconnectTimer = null; |
| 4948 | } | 4957 | } |
| 4958 | + // 清除日志刷新定时器 | ||
| 4959 | + if (reportLogRefreshInterval) { | ||
| 4960 | + clearInterval(reportLogRefreshInterval); | ||
| 4961 | + reportLogRefreshInterval = null; | ||
| 4962 | + } | ||
| 4949 | clearStreamHeartbeat(); | 4963 | clearStreamHeartbeat(); |
| 4950 | if (!keepIndicator) { | 4964 | if (!keepIndicator) { |
| 4951 | updateReportStreamStatus('idle'); | 4965 | updateReportStreamStatus('idle'); |
-
Please register or login to post a comment