MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sentinelScriptRetryDelay

Function sentinelScriptRetryDelay

app/redis-6.2.6/src/sentinel.c:897–902  ·  view source on GitHub ↗

How much to delay the execution of a script that we need to retry after * an error? * * We double the retry delay for every further retry we do. So for instance * if RETRY_DELAY is set to 30 seconds and the max number of retries is 10 * starting from the second attempt to execute the script the delays are: * 30 sec, 60 sec, 2 min, 4 min, 8 min, 16 min, 32 min, 64 min, 128 min. */

Source from the content-addressed store, hash-verified

895 * starting from the second attempt to execute the script the delays are:
896 * 30 sec, 60 sec, 2 min, 4 min, 8 min, 16 min, 32 min, 64 min, 128 min. */
897mstime_t sentinelScriptRetryDelay(int retry_num) {
898 mstime_t delay = SENTINEL_SCRIPT_RETRY_DELAY;
899
900 while (retry_num-- > 1) delay *= 2;
901 return delay;
902}
903
904/* Check for scripts that terminated, and remove them from the queue if the
905 * script terminated successfully. If instead the script was terminated by

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected