From 10f4e8256966093a94e36ce452e5268a3afbef70 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 16 Jan 2024 20:29:28 -0600 Subject: [PATCH] fixup logging --- codex/blockexchange/engine/engine.nim | 2 +- codex/stores/repostore.nim | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/codex/blockexchange/engine/engine.nim b/codex/blockexchange/engine/engine.nim index 649edec6..c24a0104 100644 --- a/codex/blockexchange/engine/engine.nim +++ b/codex/blockexchange/engine/engine.nim @@ -450,7 +450,7 @@ proc wantListHandler*( trace "Sending presence to remote", items = presence.len await b.network.request.sendPresence(peer, presence) - trace "Scheduling a task for this peer, to look over their want-list", peer + trace "Scheduling a task to check want-list", peer if not b.scheduleTask(peerCtx): trace "Unable to schedule task for peer", peer diff --git a/codex/stores/repostore.nim b/codex/stores/repostore.nim index 1d95b245..45faefbd 100644 --- a/codex/stores/repostore.nim +++ b/codex/stores/repostore.nim @@ -241,7 +241,7 @@ method ensureExpiry*( cid: Cid, expiry: SecondsSince1970 ): Future[?!void] {.async.} = - ## Ensure that block's assosicated expiry is at least given timestamp + ## Ensure that block's associated expiry is at least given timestamp ## If the current expiry is lower then it is updated to the given one, otherwise it is left intact ## @@ -262,8 +262,12 @@ method ensureExpiry*( error "Could not read datastore key", err = err.msg return failure(err) + logScope: + current = currentExpiry.toSecondsSince1970 + ensuring = expiry + if expiry <= currentExpiry.toSecondsSince1970: - trace "Current expiry is larger than or equal to the specified one, no action needed", current = currentExpiry.toSecondsSince1970, ensuring = expiry + trace "Expiry is larger than or equal to requested" return success() if err =? (await self.metaDs.put(expiryKey, expiry.toBytes)).errorOption: