Skip to content

Commit 3da409b

Browse files
Merge pull request #1993 from redis/DOC-5585-node-redis-reconnect-info
DOC-5585 fix node-redis reconnection details
2 parents 82df921 + ba8ebc5 commit 3da409b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

content/develop/clients/nodejs/connect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ You can also set the
287287
whether to try to reconnect and how to approach it. Choose one of the following values for
288288
`socket.reconnectionStrategy`:
289289

290-
- `false`: (Default) Don't attempt to reconnect.
290+
- `false`: Don't attempt to reconnect.
291291
- `number`: Wait for this number of milliseconds and then attempt to reconnect.
292292
- `<function>`: Use a custom
293293
function to decide how to handle reconnection.

content/develop/clients/nodejs/migration.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ each feature.
3434
| Feature | `ioredis` | `node-redis` |
3535
| :-- | :-- | :-- |
3636
| [Initial connection](#initial-connection) | Happens when you create a client instance | Requires you to call a method on the client instance |
37-
| [Reconnection after a connection is lost](#reconnection) | Automatic by default | Manual by default |
37+
| [Reconnection after a connection is lost](#reconnection) | Automatic by default | Automatic by default and configurable |
3838
| [Connection events](#connection-events) | Emits `connect`, `ready`, `error`, and `close` events | Emits `connect`, `ready`, `error`, `end`, and `reconnecting` events |
3939

4040
### Command handling
@@ -91,9 +91,8 @@ await client.connect(); // Requires explicit connection.
9191

9292
### Reconnection after a connection is lost {#reconnection}
9393

94-
`ioredis` automatically attempts to reconnect if the connection
95-
was lost due to an error. By default, `node-redis` doesn't attempt
96-
to reconnect, but you can enable a custom reconnection strategy
94+
Both `ioredis` and `node-redis` automatically attempt to reconnect if the connection
95+
was lost due to an error. `node-redis` also lets you add a custom reconnection strategy
9796
when you create the client object. See
9897
[Reconnect after disconnection]({{< relref "/develop/clients/nodejs/connect#reconnect-after-disconnection" >}})
9998
for more information.

0 commit comments

Comments
 (0)