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
The test times out if the client is not manually closed, even if closeClient is enabled.
test('custom ioredis client that is already connected',(t)=>{t.plan(9)constfastify=Fastify()constRedis=require('ioredis')constredis=newRedis({host: 'localhost',port: 6379})// use the client now, so that it is connected and readyredis.set('key','value',(err)=>{t.error(err)redis.get('key',(err,val)=>{t.error(err)t.equal(val,'value')fastify.register(fastifyRedis,{client: redis,lazyConnect: false,closeClient: true})fastify.ready((err)=>{t.error(err)t.equal(fastify.redis,redis)fastify.redis.set('key2','value2',(err)=>{t.error(err)fastify.redis.get('key2',(err,val)=>{t.error(err)t.equal(val,'value2')fastify.close(function(err){t.error(err)// fastify.redis.quit(function (err) {// t.error(err)// })})})})})})})})
Expected Behavior
fix closeClient to work
remove the closeClient type definition ( = client must be closed manually).
I prefer 1.
Please tell me which solution to take, and I will send PR.
The text was updated successfully, but these errors were encountered:
Prerequisites
Fastify version
^4.0.0
Plugin version
^6.0.0
Node.js version
18.14.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
13.3
Description
Since 6.0.0 closeClient does not work, but it continues to exist in index.d.ts.
#147
Steps to Reproduce
The test times out if the client is not manually closed, even if closeClient is enabled.
Expected Behavior
I prefer 1.
Please tell me which solution to take, and I will send PR.
The text was updated successfully, but these errors were encountered: