fix(web): 降低 dashboard SSE 暫時重連噪音
This commit is contained in:
@@ -287,11 +287,10 @@ export const useDashboardStore = create<DashboardState>()(
|
||||
|
||||
// Error handling with exponential backoff
|
||||
eventSource.onerror = (e) => {
|
||||
console.error('[SSE] Error:', e)
|
||||
|
||||
const attempts = get().reconnectAttempts
|
||||
|
||||
if (attempts >= MAX_RECONNECT_ATTEMPTS) {
|
||||
console.error('[SSE] Max reconnect attempts reached:', e)
|
||||
set({
|
||||
connectionStatus: 'error',
|
||||
error: 'Max reconnection attempts reached',
|
||||
@@ -312,7 +311,7 @@ export const useDashboardStore = create<DashboardState>()(
|
||||
MAX_RECONNECT_DELAY
|
||||
)
|
||||
|
||||
console.log(`[SSE] Reconnecting in ${delay}ms (attempt ${attempts + 1})`)
|
||||
console.warn(`[SSE] Reconnecting in ${delay}ms (attempt ${attempts + 1})`, e)
|
||||
|
||||
if (reconnectTimeout) clearTimeout(reconnectTimeout)
|
||||
reconnectTimeout = setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user