Skip to content

Commit 814d07d

Browse files
committed
revert this too make PR easier.
1 parent a25adf8 commit 814d07d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

apps/web-evals/src/hooks/use-event-source.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,12 @@ export function useEventSource({ url, withCredentials, onMessage }: UseEventSour
7070
// Clean up current connection.
7171
cleanup()
7272

73-
// Attempt to reconnect after a delay with a simple backoff, with a maximum retry limit.
74-
if (!sourceRef.current) {
75-
return;
76-
}
77-
const retryCount = (sourceRef.current.retryCount || 0) + 1;
78-
sourceRef.current.retryCount = retryCount;
79-
if (retryCount > 5) {
80-
return;
81-
}
73+
// Attempt to reconnect after a delay.
8274
reconnectTimeoutRef.current = setTimeout(() => {
8375
if (!isUnmountedRef.current) {
8476
createEventSource()
8577
}
86-
}, 1000 * retryCount) // Exponential backoff: 1s, 2s, 3s, etc.
78+
}, 1000)
8779
}
8880
}, [url, withCredentials, handleMessage, cleanup])
8981

0 commit comments

Comments
 (0)