Skip to content

Commit efd5023

Browse files
committed
Use ioredis by default
1 parent 39585d5 commit efd5023

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
'use strict'
22

33
const fp = require('fastify-plugin')
4-
const redis = require('redis')
4+
const Redis = require('ioredis')
55

66
function fastifyRedis (fastify, options, next) {
77
var client = options.client || null
88

99
if (!client) {
1010
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)
11+
client = new Redis(options)
1512
} catch (err) {
1613
return next(err)
1714
}
@@ -29,6 +26,6 @@ function close (fastify, done) {
2926
}
3027

3128
module.exports = fp(fastifyRedis, {
32-
fastify: '>=0.39',
29+
fastify: '>=1.x',
3330
name: 'fastify-redis'
3431
})

0 commit comments

Comments
 (0)