Skip to content

Commit

Permalink
dbconn: add db detail in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Sep 27, 2024
1 parent 2cea2aa commit c61e188
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions waku/common/databases/db_postgres/dbconn.nim
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ proc waitQueryToFinish(
## The 'rowCallback' param is != nil when the underlying query wants to retrieve results (SELECT.)
## For other queries, like "INSERT", 'rowCallback' should be nil.

debug "waitQueryToFinish", requestId
debug "waitQueryToFinish", requestId, db = db.repr
var dataAvailable = false
proc onDataAvailable(udata: pointer) {.gcsafe, raises: [].} =
dataAvailable = true
Expand All @@ -142,10 +142,10 @@ proc waitQueryToFinish(
asyncengine.addReader2(asyncFd, onDataAvailable).isOkOr:
return err("failed to add event reader in waitQueryToFinish: " & $error)

debug "waitQueryToFinish", requestId
debug "waitQueryToFinish", requestId, db = db.repr
while not dataAvailable:
await sleepAsync(timer.milliseconds(1))
debug "waitQueryToFinish", requestId
debug "waitQueryToFinish", requestId, db = db.repr

## Now retrieve the result
while true:
Expand All @@ -155,7 +155,7 @@ proc waitQueryToFinish(
db.check().isOkOr:
return err("error in query: " & $error)

debug "waitQueryToFinish", requestId
debug "waitQueryToFinish", requestId, db = db.repr

return ok() # reached the end of the results

Expand Down

0 comments on commit c61e188

Please sign in to comment.