From 273009a9190ab46d26e330b1628e722a0de364c1 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 11 May 2022 20:30:26 +0200 Subject: [PATCH] fix: Avoid incorrect error log for Redis write in reshare mode --- src/storage/secondary/RedisStorage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); } } -- 2.47.2