Skip to content

Commit

Permalink
postgres_driver: some better logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Aug 19, 2024
1 parent d046fc8 commit c7349b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions waku/waku_archive/driver/postgres_driver/postgres_driver.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1527,22 +1527,22 @@ proc analyzeTableLoop(self: PostgresDriver) {.async.} =
## The database stats should be calculated regularly so that the planner
## picks up the proper indexes and we have better query performance.
while true:
debug "analyzeTable lock db"
debug "analyzeTableLoop lock db"
(await self.acquireDatabaseLock(AnalyzeTableLockId)).isOkOr:
if error != EXPECTED_LOCK_ERROR:
error "failed to acquire lock in analyzeTable", error = error
error "failed to acquire lock in analyzeTableLoop", error = error
await sleepAsync(RunAnalyzeInterval)
continue

debug "analyzeTable start"
debug "analyzeTableLoop start analysis"
(await self.performWriteQuery(AnalyzeQuery)).isOkOr:
error "failed to run ANALYZE messages", error = error

debug "analyzeTable unlock db"
debug "analyzeTableLoop unlock db"
(await self.releaseDatabaseLock(AnalyzeTableLockId)).isOkOr:
error "failed to release lock analyzeTable", error = error
error "failed to release lock analyzeTableLoop", error = error

debug "analyzeTable completed"
debug "analyzeTableLoop analysis completed"

await sleepAsync(RunAnalyzeInterval)

Expand Down

0 comments on commit c7349b2

Please sign in to comment.