Skip to content
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

Quit is not getting closed #2723

Open
Senthilmj opened this issue Mar 21, 2024 · 3 comments
Open

Quit is not getting closed #2723

Senthilmj opened this issue Mar 21, 2024 · 3 comments
Labels

Comments

@Senthilmj
Copy link

Description

Added this best practice for Node.js from this link (https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#file-redis-bestpractices-node-js-md). When we don't get a response within 30 seconds, we disconnect and reconnect Redis. The issue here is, after calling quit, no other code is executing. I'm not getting the Redis disconnected message in logger, so we're only throwing "Redis is not connected" message. Only a restart will fix the issue. Can anyone tell what the issue is here and what we can do to fix this?

        Logger.log(` Redis disconnecting`);
        await redisClient.quit();
        Logger.log(`Redis disconnected`);

Node.js Version

16.13.0

Redis Server Version

No response

Node Redis Version

4.5.1

Platform

Linux

Logs

No response

@Senthilmj Senthilmj added the Bug label Mar 21, 2024
@lawfulsoftware
Copy link

QUIT is deprecated as of 7.2.0

The documentation should be updated.

@ivan-kleshnin
Copy link

ivan-kleshnin commented Jul 3, 2024

We should use await client.disconnect(), right?

@leibale
Copy link
Collaborator

leibale commented Jul 3, 2024

.quit closes the client gracefully (wait for all the commands before closing, but do not accept new ones) while .disconnect closes the client "forcefully" (will not wait for commands that are currently executed or in the queue). If you are using the legacyMode you might want to use client.v4.quit/client.v4.disconnect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants