mirror of
https://github.com/php-win-ext/phpredis.git
synced 2026-03-24 00:52:16 +01:00
Add maxRetries to redis_sock_configure.
This lets users configure `maxRetries` with `RedisSentinel` Fixes #2700
This commit is contained in:
committed by
Michael Grunder
parent
f9f609e1eb
commit
e9e9e49509
@@ -3049,6 +3049,12 @@ redis_sock_configure(RedisSock *redis_sock, HashTable *opts)
|
||||
} else {
|
||||
redis_sock->persistent = zval_is_true(val);
|
||||
}
|
||||
} else if (zend_string_equals_literal_ci(zkey, "maxRetries")) {
|
||||
if (Z_TYPE_P(val) != IS_LONG || Z_LVAL_P(val) < 0) {
|
||||
REDIS_VALUE_EXCEPTION("Max retries must be a non-negative integer");
|
||||
return FAILURE;
|
||||
}
|
||||
redis_sock->max_retries = zval_get_long(val);
|
||||
} else if (zend_string_equals_literal_ci(zkey, "retryInterval")) {
|
||||
if (Z_TYPE_P(val) != IS_LONG && Z_TYPE_P(val) != IS_DOUBLE) {
|
||||
REDIS_VALUE_EXCEPTION("Invalid retry interval");
|
||||
|
||||
Reference in New Issue
Block a user