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

NodeJS connectTimeout option #2710

Open
JohnGale87 opened this issue Apr 5, 2024 · 2 comments
Open

NodeJS connectTimeout option #2710

JohnGale87 opened this issue Apr 5, 2024 · 2 comments

Comments

@JohnGale87
Copy link

The documentation specifies that the node js client options accepts a timeout parameter

To set a timeout for a connection, use the `connectTimeout` option:

When I use this option in my Typescript Project, it tells me it 'connectTimeout' does not exist in type 'RedisClientOptions<RedisModules, RedisFunctions, RedisScripts>'

I'm not sure if it is the documentation or the type definitions that are incorrect.

@Swayam-Shree
Copy link

I am facing the same issue. did you find any fix?

@JohnGale87
Copy link
Author

I am facing the same issue. did you find any fix?

Possibly too late to help, but maybe could help others...

import { createClient } from "redis";
const redisClient = await createClient({
    socket: {
        connectTimeout: number,
    },
});

The option is nested under socket but the documentation doesn't match.

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

No branches or pull requests

2 participants