From d0c8bd7756ae87c346ed38dd35d92d5c5a071a29 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Fri, 15 Dec 2023 18:18:28 +0100 Subject: [PATCH] archive.nim: only move to trace the log of duplicate key This condition happens when multiple nodes share the same database --- waku/waku_archive/archive.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/waku/waku_archive/archive.nim b/waku/waku_archive/archive.nim index 7f7b165923..4a7943a983 100644 --- a/waku/waku_archive/archive.nim +++ b/waku/waku_archive/archive.nim @@ -111,7 +111,10 @@ proc handleMessage*(w: WakuArchive, let putRes = await w.driver.put(pubsubTopic, msg, msgDigest, msgHash, msgReceivedTime) if putRes.isErr(): - trace "failed to insert message", err=putRes.error + if "duplicate key value violates unique constraint" in putRes.error: + trace "failed to insert message", err=putRes.error + else: + debug "failed to insert message", err=putRes.error waku_archive_errors.inc(labelValues = [insertFailure]) let insertDuration = getTime().toUnixFloat() - insertStartTime