You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[options.enableReadyCheck]| <code>boolean</code> | <code>true</code> | When a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server not respond to any commands. To work around this, when this option is `true`, ioredis will check the status of the Redis server, and when the Redis server is able to process commands, a `ready` event will be emitted. |
56
56
|[options.enableOfflineQueue]| <code>boolean</code> | <code>true</code> | By default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection is "ready" (when `enableReadyCheck` is `true`, "ready" means the Redis server has loaded the database from disk, otherwise means the connection to the Redis server has been established). If this option is false, when execute the command when the connection isn't ready, an error will be returned. |
57
57
|[options.connectTimeout]| <code>number</code> | <code>10000</code> | The milliseconds before a timeout occurs during the initial connection to the Redis server. |
58
+
|[options.disconnectTimeout]| <code>number</code> | <code>2000</code> | The milliseconds before [socket.destroy()](https://nodejs.org/dist/latest-v14.x/docs/api/net.html#net_socket_destroy_error) is called after [socket.end()](https://nodejs.org/dist/latest-v14.x/docs/api/net.html#net_socket_end_data_encoding_callback) if the connection remains half-open during disconnection. |
58
59
|[options.autoResubscribe]| <code>boolean</code> | <code>true</code> | After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels. |
59
60
|[options.autoResendUnfulfilledCommands]| <code>boolean</code> | <code>true</code> | If true, client will resend unfulfilled commands(e.g. block commands) in the previous connection when reconnected. |
60
61
|[options.lazyConnect]| <code>boolean</code> | <code>false</code> | By default, When a new `Redis` instance is created, it will connect to Redis server automatically. If you want to keep the instance disconnected until a command is called, you can pass the `lazyConnect` option to the constructor: `javascript var redis = new Redis({ lazyConnect: true }); // No attempting to connect to the Redis server here. // Now let's connect to the Redis server redis.get('foo', function () { });`|
@@ -96,7 +97,7 @@ unless `lazyConnect: true` is passed.
96
97
When calling this method manually, a Promise is returned, which will
97
98
be resolved when the connection status is ready.
98
99
99
-
**Kind**: instance method of [<code>Redis</code>](#Redis)
100
+
**Kind**: instance method of [<code>Redis</code>](#Redis)
100
101
**Access**: public
101
102
102
103
| Param | Type |
@@ -113,8 +114,8 @@ This method closes the connection immediately,
113
114
and may lose some pending replies that haven't written to client.
114
115
If you want to wait for the pending replies, use Redis#quit instead.
115
116
116
-
**Kind**: instance method of [<code>Redis</code>](#Redis)
117
-
**Access**: public
117
+
**Kind**: instance method of [<code>Redis</code>](#Redis)
118
+
**Access**: public
118
119
<aname="Redis+end"></a>
119
120
120
121
### ~~redis.end()~~
@@ -123,15 +124,15 @@ If you want to wait for the pending replies, use Redis#quit instead.
123
124
124
125
Disconnect from Redis.
125
126
126
-
**Kind**: instance method of [<code>Redis</code>](#Redis)
127
+
**Kind**: instance method of [<code>Redis</code>](#Redis)
127
128
<aname="Redis+duplicate"></a>
128
129
129
130
### redis.duplicate()
130
131
131
132
Create a new instance with the same options as the current one.
132
133
133
-
**Kind**: instance method of [<code>Redis</code>](#Redis)
134
-
**Access**: public
134
+
**Kind**: instance method of [<code>Redis</code>](#Redis)
135
+
**Access**: public
135
136
**Example**
136
137
137
138
```js
@@ -149,7 +150,7 @@ This command will create a new connection to Redis and send a
149
150
MONITOR command via the new connection in order to avoid disturbing
150
151
the current connection.
151
152
152
-
**Kind**: instance method of [<code>Redis</code>](#Redis)
153
+
**Kind**: instance method of [<code>Redis</code>](#Redis)
0 commit comments