fixup logging

This commit is contained in:
Dmitriy Ryajov 2024-01-16 20:29:28 -06:00
parent 6c28c2af88
commit 10f4e82569
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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: