Skip to content

Commit a5f2d44

Browse files
committed
Fix case where pingTimeoutDisabled is true
1 parent 7294692 commit a5f2d44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/transport.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,17 @@ AGTransport.prototype._onError = function (error) {
320320
};
321321

322322
AGTransport.prototype.isStale = function () {
323+
if (this.pingTimeoutDisabled) return false;
323324
return Date.now() - this.lastPingTimestamp >= this.pingTimeout;
324325
};
325326

326327
AGTransport.prototype._resetPingTimeout = function () {
328+
this.lastPingTimestamp = Date.now();
329+
327330
if (this.pingTimeoutDisabled) {
328331
return;
329332
}
330333

331-
this.lastPingTimestamp = Date.now();
332334
clearTimeout(this._pingTimeoutTicker);
333335
this._pingTimeoutTicker = setTimeout(() => {
334336
this._destroy(4000);

0 commit comments

Comments
 (0)