Skip to content

Commit

Permalink
more temporary logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Sep 28, 2024
1 parent d758f2e commit 57b0f7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vendor/nim-chronos
11 changes: 10 additions & 1 deletion waku/common/databases/db_postgres/dbconn.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import
chronos/threadsync,
metrics,
re,
chronicles
chronicles,
stew/base10
import ./query_metrics

include db_connector/db_postgres
Expand Down Expand Up @@ -140,6 +141,13 @@ 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.

for item in pendingFutures():
let loc = item.location[LocCreateIndex][]
let futureId = Base10.toString(item.id)

# debug "pending futures", loc, futureId, count = pendingFuturesCount()
debug "pending futures", count = pendingFuturesCount()

var triggered = false
var signal = ThreadSignalPtr.new().valueOr:
return err("error creating ThreadSignalPtr in waitQueryToFinish: " & $error)
Expand All @@ -162,6 +170,7 @@ proc waitQueryToFinish(

debug "waitQueryToFinish", requestId, connName = db.connName
await signal.wait()
debug "waitQueryToFinish", requestId, connName = db.connName

## Now retrieve the result
while true:
Expand Down

0 comments on commit 57b0f7d

Please sign in to comment.