File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,8 @@ export class SocketIOProvider extends Observable {
351351 * @readonly
352352 */
353353 onSocketDisconnection = ( event ) => {
354+ if ( event === 'io server disconnect' ) this . socket . connect ( )
355+
354356 this . emit ( 'connection-close' , [ event , this ] )
355357 this . synced = false
356358 AwarenessProtocol . removeAwarenessStates (
Original file line number Diff line number Diff line change @@ -211,7 +211,11 @@ export class YSocketIO {
211211 const namespace = this . getNamespaceString ( socket . nsp )
212212 if ( toobusy ( ) ) {
213213 logSocketIO ( `warning server too busy, rejecting connection: ${ namespace } ` )
214- throw new Error ( 'server too busy, please try again latter' )
214+ // wait a bit to prevent client reconnect too fast
215+ await promise . wait ( 100 )
216+ socket . send ( 'server too busy, please try again latter' )
217+ socket . disconnect ( true )
218+ return
215219 }
216220 if ( ! socket . user ) throw new Error ( 'user does not exist in socket' )
217221
You can’t perform that action at this time.
0 commit comments