Skip to content

Commit

Permalink
timeout option in redisConnectWithOptions should be on connect only (r…
Browse files Browse the repository at this point in the history
…edis#829)

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

See related issue redis#722
  • Loading branch information
valentinogeron authored Jun 19, 2020
1 parent 6448f73 commit a28de70
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hiredis.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,7 @@ redisContext *redisConnectWithOptions(const redisOptions *options) {
// Unknown type - FIXME - FREE
return NULL;
}
if (options->timeout != NULL && (c->flags & REDIS_BLOCK) && c->fd != REDIS_INVALID_FD) {
redisContextSetTimeout(c, *options->timeout);
}

return c;
}

Expand Down

0 comments on commit a28de70

Please sign in to comment.