You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
feat(client): expose socketTimeout option (#2965)
The maximum duration (in milliseconds) that the socket can remain idle (i.e., with no data sent or received) before being automatically closed. Default reconnectionStrategy will ignore the new SocketTimeoutError, but users are allowed to have custom strategies wich handle those errors in different ways
This commit is contained in:
committed by
GitHub
parent
d0a5c4c945
commit
f3d1d3352e
@@ -16,6 +16,12 @@ export class ConnectionTimeoutError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
export class SocketTimeoutError extends Error {
|
||||
constructor(timeout: number) {
|
||||
super(`Socket timeout timeout. Expecting data, but didn't receive any in ${timeout}ms.`);
|
||||
}
|
||||
}
|
||||
|
||||
export class ClientClosedError extends Error {
|
||||
constructor() {
|
||||
super('The client is closed');
|
||||
|
Reference in New Issue
Block a user