chore: faster reconnect for dev

This commit is contained in:
cha0s 2021-03-22 04:45:26 -05:00
parent 8745ac5f45
commit 0afc22b834

View File

@ -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',