Skip to content

Commit 2a5a9fc

Browse files
authored
Simplify Redis loading error check
1 parent 8218a30 commit 2a5a9fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/redisreply.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ inline void guard(FUNC func, const char* command)
128128
// Combine more error message and throw again
129129
std::string reason = ex.what();
130130
std::string errmsg = "RedisReply catches system_error: command: " + std::string(command) + ", reason: " + reason;
131-
if (reason.find("LOADING Redis is loading the dataset in memory") != std::string::npos)
131+
if (reason.rfind("LOADING ", 0) == 0)
132132
{
133133
// The command will fail when Redis is loading the dataset.
134134
SWSS_LOG_WARN("%s", errmsg.c_str());

0 commit comments

Comments
 (0)