-
-
Notifications
You must be signed in to change notification settings - Fork 34
Add option to close passed in client #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -55,6 +55,9 @@ function fastifyRedis (fastify, options, next) { | |||
} | |||
|
|||
fastify.decorate('redis', client) | |||
if (options.closeClient === true) { | |||
fastify.addHook('onClose', close) | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we would need to support when this is false
in all cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about that. The issue is around passing in a specific client and managing that outside instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, if somebody is not passing a client in and closeClient: false
, then closing the client seems off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unclear why they would do that or why it would even be supported. They wouldn't be able to manage it without first pulling the instance from Fastify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, let's ship this anyway :)
At your leisure. I have no permissions here. |
Resolves issue #64
Checklist
npm run test
andnpm run benchmark
and the Code of conduct