From 0afc22b834f7fa14ef3634eb2488dd50b3bce04e Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 22 Mar 2021 04:45:26 -0500 Subject: [PATCH] chore: faster reconnect for dev --- packages/socket/src/client/socket.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/socket/src/client/socket.js b/packages/socket/src/client/socket.js index aabd92b..57d3511 100644 --- a/packages/socket/src/client/socket.js +++ b/packages/socket/src/client/socket.js @@ -30,7 +30,14 @@ export default class SocketClient extends decorate(Socket) { } this.address = address; debug('connecting to %s', this.address); - this.socket = io(this.address, this.latus.invokeReduce('@latus/socket/client')); + this.socket = io( + this.address, + { + reconnectionDelay: 'production' === process.env.NODE_ENV ? 1000 : 100, + reconnectionDelayMax: 'production' === process.env.NODE_ENV ? 5000 : 500, + ...this.latus.invokeReduce('@latus/socket/client'), + }, + ); this.socket.emitPromise = promisify(this.socket.emit.bind(this.socket)); [ 'error',