chore: improve logging (#526)

This commit is contained in:
Adam Uhlíř 2023-08-28 11:33:44 +02:00 committed by GitHub
parent 41cb658c1a
commit 098baf47d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -162,12 +162,17 @@ proc onReservationAdded(sales: Sales, availability: Availability) {.async.} =
let queue = context.slotQueue let queue = context.slotQueue
logScope: logScope:
topics = "sales onReservationAdded callback" topics = "marketplace sales onReservationAdded callback"
trace "reservation added, querying past storage requests to add to queue" trace "reservation added, querying past storage requests to add to queue"
try: try:
let events = await market.queryPastStorageRequests(256) let events = await market.queryPastStorageRequests(256)
if events.len == 0:
trace "no storage request events found in recent past"
return
let requests = events.map(event => let requests = events.map(event =>
SlotQueueItem.init(event.requestId, event.ask, event.expiry) SlotQueueItem.init(event.requestId, event.ask, event.expiry)
) )
@ -200,7 +205,7 @@ proc onStorageRequested(sales: Sales,
expiry: UInt256) = expiry: UInt256) =
logScope: logScope:
topics = "sales onStorageRequested" topics = " marketplace sales onStorageRequested"
requestId requestId
slots = ask.slots slots = ask.slots
expiry expiry
@ -235,7 +240,7 @@ proc onSlotFreed(sales: Sales,
slotIndex: UInt256) = slotIndex: UInt256) =
logScope: logScope:
topics = "sales onSlotFreed" topics = "marketplace sales onSlotFreed"
requestId requestId
slotIndex slotIndex