Skip to content

Commit

Permalink
archive.nim: only move to trace the log of duplicate key
Browse files Browse the repository at this point in the history
This condition happens when multiple nodes share the same database
  • Loading branch information
Ivansete-status committed Dec 15, 2023
1 parent 8489930 commit d0c8bd7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion waku/waku_archive/archive.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0c8bd7

Please sign in to comment.