timeout option in redisConnectWithOptions should be on connect only (#829)

When connecting with a timeout, we shouldn't also call `redisSetTimeout` which will implement a timeout for commands.

See related issue #722
This commit is contained in:
valentinogeron 2020-06-19 07:45:25 +03:00 committed by GitHub
parent 6448f735d5
commit a28de70a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -790,9 +790,7 @@ redisContext *redisConnectWithOptions(const redisOptions *options) {
// Unknown type - FIXME - FREE // Unknown type - FIXME - FREE
return NULL; return NULL;
} }
if (options->timeout != NULL && (c->flags & REDIS_BLOCK) && c->fd != REDIS_INVALID_FD) {
redisContextSetTimeout(c, *options->timeout);
}
return c; return c;
} }