We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39585d5 commit efd5023Copy full SHA for efd5023
index.js
@@ -1,17 +1,14 @@
1
'use strict'
2
3
const fp = require('fastify-plugin')
4
-const redis = require('redis')
+const Redis = require('ioredis')
5
6
function fastifyRedis (fastify, options, next) {
7
var client = options.client || null
8
9
if (!client) {
10
try {
11
- // if custom redis module, default is redis.
12
- const Driver = options.driver
13
- delete options.driver
14
- client = Driver ? new Driver(options) : redis.createClient(options)
+ client = new Redis(options)
15
} catch (err) {
16
return next(err)
17
}
@@ -29,6 +26,6 @@ function close (fastify, done) {
29
26
30
27
31
28
module.exports = fp(fastifyRedis, {
32
- fastify: '>=0.39',
+ fastify: '>=1.x',
33
name: 'fastify-redis'
34
})
0 commit comments