We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_getNextDelay
0
@bytemain there is a bug in the code causing socket to attempt to reconnect in 0ms which causes uncaught exception (e.g. if you're using ws package).
0ms
ws
function _getNextDelay() { const { reconnectionDelayGrowFactor = DEFAULT.reconnectionDelayGrowFactor, minReconnectionDelay = DEFAULT.minReconnectionDelay, maxReconnectionDelay = DEFAULT.maxReconnectionDelay } = this._options; let delay = 0; if (this._retryCount > 0) { delay = minReconnectionDelay * reconnectionDelayGrowFactor ** (this._retryCount - 1); if (delay > maxReconnectionDelay) { delay = maxReconnectionDelay; } - } + } else { + // -1 `_retryCount` indicates it's reconnecting so wait at least 1s + delay = 1000; + } this._debug('next delay', delay); return delay; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
@bytemain there is a bug in the code causing socket to attempt to reconnect in
0ms
which causes uncaught exception (e.g. if you're usingws
package).The text was updated successfully, but these errors were encountered: