Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ const client = new Redis({ host: 'localhost', port: 6379 })
fastify.register(require('@fastify/redis'), { client })
```

You can also supply a *Redis Cluster* instance to the client:

```js
'use strict'

const fastify = require('fastify')()
const Redis = require('ioredis')

const client = new Redis.Cluster([{ host: 'localhost', port: 6379 }]);

fastify.register(require('@fastify/redis'), { client })
```

Note: by default, *@fastify/redis* will **not** automatically close the client
connection when the Fastify server shuts down.

Expand Down