File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,6 @@ function createServerAndClient(pool: Pool, channelPrefix: string) {
3838 } ) ,
3939 } ) ;
4040
41- // calling init() sends an INITIAL_HEARTBEAT message to the other nodes, so each node knows about the others
42- io . of ( "/" ) . adapter . init ( ) ;
43-
4441 return new Promise < {
4542 io : Server ;
4643 socket : ServerSocket ;
@@ -103,8 +100,11 @@ export async function setup() {
103100 const serverSockets = results . map ( ( { socket } ) => socket ) ;
104101 const clientSockets = results . map ( ( { clientSocket } ) => clientSocket ) ;
105102
106- while ( ! isInitComplete ( servers ) ) {
107- await sleep ( 20 ) ;
103+ for ( let i = 0 ; ! isInitComplete ( servers ) && i < 10 ; i ++ ) {
104+ // calling init() sends an INITIAL_HEARTBEAT message to the other nodes, so each node knows about the others
105+ servers [ 0 ] . of ( "/" ) . adapter . init ( ) ;
106+
107+ await sleep ( 50 ) ;
108108 }
109109
110110 return {
You can’t perform that action at this time.
0 commit comments