MCPcopy
hub / github.com/redis/ioredis / setTimeout

Method setTimeout

lib/Command.ts:375–383  ·  view source on GitHub ↗

* Set the wait time before terminating the attempt to execute a command * and generating an error.

(ms: number)

Source from the content-addressed store, hash-verified

373 * and generating an error.
374 */
375 setTimeout(ms: number) {
376 if (!this._commandTimeoutTimer) {
377 this._commandTimeoutTimer = setTimeout(() => {
378 if (!this.isResolved) {
379 this.reject(new Error("Command timed out"));
380 }
381 }, ms);
382 }
383 }
384
385 /**
386 * Set a timeout for blocking commands.

Callers 2

_connectMethod · 0.80
sendCommandMethod · 0.80

Calls 1

rejectMethod · 0.80

Tested by

no test coverage detected