Log the time to lock package_versions_by_guix_revision_range

This commit is contained in:
Christopher Baines 2020-02-02 10:24:29 +01:00
parent 908f6d3eee
commit 65850669a0

View file

@ -984,13 +984,16 @@ WHERE job_id = $1"
(display-backtrace (make-stack #t) (current-error-port))))))) (display-backtrace (make-stack #t) (current-error-port)))))))
(define (update-package-versions-table conn git-repository-id commit) (define (update-package-versions-table conn git-repository-id commit)
;; Lock the table to wait for other transactions to commit before updating (log-time
;; the table "lock table: package_versions_by_guix_revision_range"
(exec-query (lambda ()
conn ;; Lock the table to wait for other transactions to commit before updating
" ;; the table
(exec-query
conn
"
LOCK TABLE ONLY package_versions_by_guix_revision_range LOCK TABLE ONLY package_versions_by_guix_revision_range
IN SHARE ROW EXCLUSIVE MODE") IN SHARE ROW EXCLUSIVE MODE")))
(for-each (for-each
(match-lambda (match-lambda