From 7cf0e468ff504f4943727183bad894cc7f04a252 Mon Sep 17 00:00:00 2001 From: ShukeBta <272197458+ShukeBta@users.noreply.github.com> Date: Tue, 30 Jun 2026 20:24:40 +0800 Subject: [PATCH] chore remove sse debug logging --- web/src/hooks/useSSE.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/web/src/hooks/useSSE.ts b/web/src/hooks/useSSE.ts index 51a7161..3e9e46c 100644 --- a/web/src/hooks/useSSE.ts +++ b/web/src/hooks/useSSE.ts @@ -16,7 +16,7 @@ type SSEEventHandler = (event: SSEEvent) => void * function MyComponent() { * const { connect, disconnect } = useSSE((event) => { * if (event.type === 'scan') { - * console.log('Scan progress:', event.payload) + * updateScanProgress(event.payload) * } * }) * @@ -59,7 +59,6 @@ export function useSSE( eventSource.onopen = () => { isConnectedRef.current = true reconnectAttemptsRef.current = 0 - console.log('SSE connected') } eventSource.onmessage = (event) => { @@ -79,18 +78,12 @@ export function useSSE( if (reconnectAttemptsRef.current < maxReconnectAttempts) { const delay = Math.min(1000 * Math.pow(2, reconnectAttemptsRef.current), 30000) reconnectAttemptsRef.current++ - console.log(`SSE reconnecting in ${delay}ms (attempt ${reconnectAttemptsRef.current})`) reconnectTimeoutRef.current = setTimeout(connect, delay) } else { console.error('SSE connection failed after max attempts') } } - // 自定义事件类型 - eventSource.addEventListener('connected', (event) => { - console.log('SSE handshake received:', event) - }) - }, [onEvent]) const disconnect = useCallback(() => {