From: Joel Rosdahl Date: Wed, 11 May 2022 18:30:26 +0000 (+0200) Subject: fix: Avoid incorrect error log for Redis write in reshare mode X-Git-Tag: v4.6.1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=273009a9190ab46d26e330b1628e722a0de364c1;p=thirdparty%2Fccache.git fix: Avoid incorrect error log for Redis write in reshare mode --- diff --git a/src/storage/secondary/RedisStorage.cpp b/src/storage/secondary/RedisStorage.cpp index 2a5922fba..288fe35fa 100644 --- a/src/storage/secondary/RedisStorage.cpp +++ b/src/storage/secondary/RedisStorage.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021 Joel Rosdahl and other contributors +// Copyright (C) 2021-2022 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -180,11 +180,11 @@ RedisStorageBackend::put(const Digest& key, const auto reply = redis_command("EXISTS %s", key_string.c_str()); if (!reply) { return nonstd::make_unexpected(reply.error()); - } else if ((*reply)->type == REDIS_REPLY_INTEGER && (*reply)->integer > 0) { + } else if ((*reply)->type != REDIS_REPLY_INTEGER) { + LOG("Unknown reply type: {}", (*reply)->type); + } else if ((*reply)->integer > 0) { LOG("Entry {} already in Redis", key_string); return false; - } else { - LOG("Unknown reply type: {}", (*reply)->type); } }