mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
revert this too make PR easier.
This commit is contained in:
parent
a25adf8bbe
commit
814d07dcca
1 changed files with 2 additions and 10 deletions
|
|
@ -70,20 +70,12 @@ export function useEventSource({ url, withCredentials, onMessage }: UseEventSour
|
|||
// Clean up current connection.
|
||||
cleanup()
|
||||
|
||||
// Attempt to reconnect after a delay with a simple backoff, with a maximum retry limit.
|
||||
if (!sourceRef.current) {
|
||||
return;
|
||||
}
|
||||
const retryCount = (sourceRef.current.retryCount || 0) + 1;
|
||||
sourceRef.current.retryCount = retryCount;
|
||||
if (retryCount > 5) {
|
||||
return;
|
||||
}
|
||||
// Attempt to reconnect after a delay.
|
||||
reconnectTimeoutRef.current = setTimeout(() => {
|
||||
if (!isUnmountedRef.current) {
|
||||
createEventSource()
|
||||
}
|
||||
}, 1000 * retryCount) // Exponential backoff: 1s, 2s, 3s, etc.
|
||||
}, 1000)
|
||||
}
|
||||
}, [url, withCredentials, handleMessage, cleanup])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue