diff --git a/cluster_library.c b/cluster_library.c index 9258fca..3bd4fc7 100644 --- a/cluster_library.c +++ b/cluster_library.c @@ -833,7 +833,7 @@ PHP_REDIS_API redisCluster *cluster_create(double timeout, double read_timeout, c->err = NULL; /* Set up our waitms based on timeout */ - c->waitms = (long)(1000 * timeout); + c->waitms = (long)(1000 * (timeout + read_timeout)); /* Allocate our seeds hash table */ ALLOC_HASHTABLE(c->seeds); diff --git a/redis_cluster.c b/redis_cluster.c index 599449a..77d0106 100644 --- a/redis_cluster.c +++ b/redis_cluster.c @@ -139,7 +139,7 @@ static void redis_cluster_init(redisCluster *c, HashTable *ht_seeds, double time c->flags->timeout = timeout; c->flags->read_timeout = read_timeout; c->flags->persistent = persistent; - c->waitms = timeout * 1000L; + c->waitms = (long)(1000 * (timeout + read_timeout)); /* Attempt to load slots from cache if caching is enabled */ if (CLUSTER_CACHING_ENABLED()) {