Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e9e9e49

Browse filesBrowse files
Add maxRetries to redis_sock_configure.
This lets users configure `maxRetries` with `RedisSentinel` Fixes #2700
1 parent f9f609e commit e9e9e49
Copy full SHA for e9e9e49

1 file changed

+6Lines changed: 6 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎library.c‎

Copy file name to clipboardExpand all lines: library.c
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,6 +3049,12 @@ redis_sock_configure(RedisSock *redis_sock, HashTable *opts)
30493049
} else {
30503050
redis_sock->persistent = zval_is_true(val);
30513051
}
3052+
} else if (zend_string_equals_literal_ci(zkey, "maxRetries")) {
3053+
if (Z_TYPE_P(val) != IS_LONG || Z_LVAL_P(val) < 0) {
3054+
REDIS_VALUE_EXCEPTION("Max retries must be a non-negative integer");
3055+
return FAILURE;
3056+
}
3057+
redis_sock->max_retries = zval_get_long(val);
30523058
} else if (zend_string_equals_literal_ci(zkey, "retryInterval")) {
30533059
if (Z_TYPE_P(val) != IS_LONG && Z_TYPE_P(val) != IS_DOUBLE) {
30543060
REDIS_VALUE_EXCEPTION("Invalid retry interval");

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.