Commit 3f95fcda authored by michael-grunder's avatar michael-grunder Committed by Michael Grunder
Browse files

Don't attempt to set a timeout if we are in an error state.

parent aacb84b8
......@@ -860,7 +860,9 @@ redisContext *redisConnectWithOptions(const redisOptions *options) {
return NULL;
}
if (options->command_timeout != NULL && (c->flags & REDIS_BLOCK) && c->fd != REDIS_INVALID_FD) {
if (c->err == 0 && c->fd != REDIS_INVALID_FD &&
options->command_timeout != NULL && (c->flags & REDIS_BLOCK))
{
redisContextSetTimeout(c, *options->command_timeout);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment