Make valkey compatible with redis-sentinel to start sentinel (#731)

We already have similar changes to check-rdb / check-aof, apply
this change to sentinel.

Fixes #719.

Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
Binbin 2024-07-02 23:32:34 +08:00 committed by GitHub
parent eff45f5467
commit 1ea49e5845
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6380,6 +6380,9 @@ void memtest(size_t megabytes, int passes);
int checkForSentinelMode(int argc, char **argv, char *exec_name) {
if (strstr(exec_name, "valkey-sentinel") != NULL) return 1;
/* valkey may install symlinks like redis-sentinel -> valkey-sentinel. */
if (strstr(exec_name, "redis-sentinel") != NULL) return 1;
for (int j = 1; j < argc; j++)
if (!strcmp(argv[j], "--sentinel")) return 1;
return 0;