Skip to content

No option for closing provided client in namespace #75

@gkampitakis

Description

@gkampitakis

🐛 Bug Report

Hey 👋,I noticed if you provide a Redis client in namespace there is no option for closing the client as you have in a non namespace instance.

To Reproduce

Steps to reproduce the behavior:

if (namespace) {
    ....
    if (!client) {
      ....
      fastify.addHook('onClose', closeNamedInstance)
    }

    fastify.redis[namespace] = client
}

Expected behavior

I would expect to have the same snippet as in non namespace

if (options.closeClient === true) {
        fastify.addHook('onClose', closeNamedInstance)
}

Sorry If I understood it wrong but this is what I would expect. If that's the case though seems a quick fix and I could create a pr for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    semver-minorIssue or PR that should land as semver minor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions