Skip to content

Commit

Permalink
some more temporary logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Sep 27, 2024
1 parent 67d6d43 commit 415d238
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions waku/common/databases/db_postgres/pgasyncpool.nim
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,12 @@ proc pgQuery*(
let connIndex = (await pool.getConnIndex()).valueOr:
return err("connRes.isErr in query: " & $error)

debug "pgQuery", conns = $pool.conns

let queryStartTime = getNowInNanosecondTime()
let conn = pool.conns[connIndex].dbConn

debug "pgQuery",
conns = $pool.conns, requestId, connIndex, connAddr = cast[uint](addr(conn))

defer:
pool.releaseConn(conn)
let queryDuration = getNowInNanosecondTime() - queryStartTime
Expand Down Expand Up @@ -206,14 +208,15 @@ proc runStmt*(
## rowCallback != nil when it is expected to retrieve info from the database.
## rowCallback == nil for queries that change the database state.

debug "runStmt", conns = $pool.conns

let connIndex = (await pool.getConnIndex()).valueOr:
return err("Error in runStmt: " & $error)

let conn = pool.conns[connIndex].dbConn
let queryStartTime = getNowInNanosecondTime()

debug "runStmt",
conns = $pool.conns, requestId, connIndex, connAddr = cast[uint](addr(conn))

defer:
pool.releaseConn(conn)
let queryDuration = getNowInNanosecondTime() - queryStartTime
Expand Down

0 comments on commit 415d238

Please sign in to comment.