nar: Avoid opening the database an additional time.

* guix/nar.scm (finalize-store-file): Call 'register-items' and pass it
DB.  This avoids opening the database a second time and hopefully
reduces contention on 'db.sqlite-shm'.
This commit is contained in:
Ludovic Courtès 2020-06-18 11:58:41 +02:00
parent 97a46055ca
commit d7fb553801
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

@ -27,6 +27,7 @@
;; (guix store) since this is "daemon-side" code.
#:use-module (guix store)
#:use-module (guix store database)
#:use-module ((guix build store-copy) #:select (store-info))
#:use-module (guix ui) ; for '_'
#:use-module (gcrypt hash)
@ -115,9 +116,8 @@ held."
;; Register TARGET. As a side effect, it resets the timestamps of all
;; its files, recursively, and runs a deduplication pass.
(register-path target
#:references references
#:deriver deriver))
(register-items db
(list (store-info target deriver references))))
(when lock?
(delete-file (string-append target ".lock"))