Fix redis-benchmark hang when it fails to connect to redis (#11366)

Forgot to start redis-server when testing performance.
When opening the benchmark for testing, it will always be stuck,
and the process cpu will reach 100%.
This commit is contained in:
yancz2000 2022-10-09 17:17:36 +08:00 committed by GitHub
parent 35b3fbd90c
commit fe0550a4a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -320,7 +320,7 @@ static redisConfig *getRedisConfig(const char *ip, int port,
c = getRedisContext(ip, port, hostsocket); c = getRedisContext(ip, port, hostsocket);
if (c == NULL) { if (c == NULL) {
freeRedisConfig(cfg); freeRedisConfig(cfg);
return NULL; exit(1);
} }
redisAppendCommand(c, "CONFIG GET %s", "save"); redisAppendCommand(c, "CONFIG GET %s", "save");
redisAppendCommand(c, "CONFIG GET %s", "appendonly"); redisAppendCommand(c, "CONFIG GET %s", "appendonly");