Comparing version 4.27.0 to 4.27.1
@@ -223,2 +223,7 @@ "use strict"; | ||
try { | ||
const existingTimer = this._commandTimeoutTimer; | ||
if (existingTimer) { | ||
clearTimeout(existingTimer); | ||
delete this._commandTimeoutTimer; | ||
} | ||
resolve(this.transformReply(value)); | ||
@@ -249,2 +254,15 @@ this.isResolved = true; | ||
} | ||
/** | ||
* Set the wait time before terminating the attempt to execute a command | ||
* and generating an error. | ||
*/ | ||
setTimeout(ms) { | ||
if (!this._commandTimeoutTimer) { | ||
this._commandTimeoutTimer = setTimeout(() => { | ||
if (!this.isResolved) { | ||
this.reject(new Error("Command timed out")); | ||
} | ||
}, ms); | ||
} | ||
} | ||
} | ||
@@ -251,0 +269,0 @@ exports.default = Command; |
@@ -629,7 +629,3 @@ "use strict"; | ||
if (typeof this.options.commandTimeout === "number") { | ||
setTimeout(() => { | ||
if (!command.isResolved) { | ||
command.reject(new Error("Command timed out")); | ||
} | ||
}, this.options.commandTimeout); | ||
command.setTimeout(this.options.commandTimeout); | ||
} | ||
@@ -636,0 +632,0 @@ if (command.name === "quit") { |
@@ -0,1 +1,8 @@ | ||
## [4.27.1](https://github.com/luin/ioredis/compare/v4.27.0...v4.27.1) (2021-04-24) | ||
### Bug Fixes | ||
* clears commandTimeout timer as each respective command gets fulfilled ([#1336](https://github.com/luin/ioredis/issues/1336)) ([d65f8b2](https://github.com/luin/ioredis/commit/d65f8b2e6603a4de32f5d97e69a99be78e50708b)) | ||
# [4.27.0](https://github.com/luin/ioredis/compare/v4.26.0...v4.27.0) (2021-04-24) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "ioredis", | ||
"version": "4.27.0", | ||
"version": "4.27.1", | ||
"description": "A robust, performance-focused and full-featured Redis client for Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "built/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
287954
4787