diff options
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm index 31f2f4d..a93b377 100644 --- a/guix-build-coordinator/datastore/sqlite.scm +++ b/guix-build-coordinator/datastore/sqlite.scm @@ -259,9 +259,10 @@ metrics-registry checkpoint-duration-metric-name (lambda () - (when (> (wal-size) extreme-wal-size-threshold) - ;; Since the WAL is really getting too big, wait for much longer - (sqlite-exec db "PRAGMA busy_timeout = 300000;")) + (if (> (wal-size) extreme-wal-size-threshold) + ;; Since the WAL is really getting too big, wait for much longer + (sqlite-exec db "PRAGMA busy_timeout = 300000;") + (sqlite-exec db "PRAGMA busy_timeout = 100;")) (let* ((statement (sqlite-prepare @@ -326,9 +327,11 @@ PRAGMA optimize;") (retry-count 0)) (if result #t - (if (< retry-count 10) - (loop (datastore-optimize datastore) - (+ 1 retry-count)) + (if (< retry-count 300) + (begin + (sleep 0.1) + (loop (datastore-optimize datastore) + (+ 1 retry-count))) (error "unable to perform WAL checkpoint")))))) #:unwind? #t))) #:parallel? #t)) |