fix reconnect config change.

This commit is contained in:
Miroslav Šedivý 2021-07-30 22:36:55 +02:00
parent 1e78e4e191
commit 262ea3dd77

View File

@ -110,7 +110,7 @@ export class Reconnector extends EventEmitter<ReconnectorEvents> {
public set config(conf: ReconnectorConfig) { public set config(conf: ReconnectorConfig) {
this._config = { ...conf } this._config = { ...conf }
if (this._config.max_reconnects > this._total_reconnects) { if (this._config.max_reconnects <= this._total_reconnects) {
this.close(new Error('reconnection config changed')) this.close(new Error('reconnection config changed'))
} }
} }