Re-arrange some of the load new revision code
Try to isolate the code that inserts in to the database, so that the relevant tables can be locked during this time.
This commit is contained in:
parent
766656086f
commit
baf2b17bf8
1 changed files with 49 additions and 41 deletions
|
|
@ -196,7 +196,15 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(deduplicate-inferior-packages
|
(deduplicate-inferior-packages
|
||||||
(inferior-packages inf)))))
|
(inferior-packages inf)))))
|
||||||
(package-license-set-ids
|
(inferior-data-4-tuples
|
||||||
|
(log-time "getting inferior derivations"
|
||||||
|
(lambda ()
|
||||||
|
(all-inferior-package-derivations store inf packages)))))
|
||||||
|
|
||||||
|
(define loading-inferior-data
|
||||||
|
(record-start-time "critical region fetching and loading inferior data"))
|
||||||
|
|
||||||
|
(let* ((package-license-set-ids
|
||||||
(log-time "fetching inferior package license metadata"
|
(log-time "fetching inferior package license metadata"
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(inferior-packages->license-set-ids conn inf
|
(inferior-packages->license-set-ids conn inf
|
||||||
|
|
@ -210,7 +218,16 @@
|
||||||
(log-time "getting package-ids"
|
(log-time "getting package-ids"
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(inferior-packages->package-ids
|
(inferior-packages->package-ids
|
||||||
conn packages packages-metadata-ids))))
|
conn packages packages-metadata-ids)))))
|
||||||
|
|
||||||
|
(simple-format
|
||||||
|
#t "debug: finished loading information from inferior\n")
|
||||||
|
(close-inferior inf)
|
||||||
|
|
||||||
|
(let* ((derivation-ids
|
||||||
|
(derivation-file-names->derivation-ids
|
||||||
|
conn
|
||||||
|
(map fourth inferior-data-4-tuples)))
|
||||||
(inferior-package-id->package-id-hash-table
|
(inferior-package-id->package-id-hash-table
|
||||||
(alist->hashq-table
|
(alist->hashq-table
|
||||||
(map (lambda (package package-id)
|
(map (lambda (package package-id)
|
||||||
|
|
@ -218,19 +235,6 @@
|
||||||
package-id))
|
package-id))
|
||||||
packages
|
packages
|
||||||
package-ids)))
|
package-ids)))
|
||||||
(inferior-data-4-tuples
|
|
||||||
(log-time "getting inferior derivations"
|
|
||||||
(lambda ()
|
|
||||||
(all-inferior-package-derivations store inf packages)))))
|
|
||||||
|
|
||||||
(simple-format
|
|
||||||
#t "debug: finished loading information from inferior\n")
|
|
||||||
(close-inferior inf)
|
|
||||||
|
|
||||||
(let ((derivation-ids
|
|
||||||
(derivation-file-names->derivation-ids
|
|
||||||
conn
|
|
||||||
(map fourth inferior-data-4-tuples)))
|
|
||||||
(flat-package-ids-systems-and-targets
|
(flat-package-ids-systems-and-targets
|
||||||
(map
|
(map
|
||||||
(match-lambda
|
(match-lambda
|
||||||
|
|
@ -239,11 +243,15 @@
|
||||||
inferior-package-id)
|
inferior-package-id)
|
||||||
system
|
system
|
||||||
target)))
|
target)))
|
||||||
inferior-data-4-tuples)))
|
inferior-data-4-tuples))
|
||||||
|
(package-derivation-ids
|
||||||
(insert-package-derivations conn
|
(insert-package-derivations conn
|
||||||
flat-package-ids-systems-and-targets
|
flat-package-ids-systems-and-targets
|
||||||
derivation-ids))))
|
derivation-ids)))
|
||||||
|
|
||||||
|
(record-end-time loading-inferior-data)
|
||||||
|
|
||||||
|
package-derivation-ids))))
|
||||||
|
|
||||||
(define (inferior-package-transitive-supported-systems package)
|
(define (inferior-package-transitive-supported-systems package)
|
||||||
((@@ (guix inferior) inferior-package-field)
|
((@@ (guix inferior) inferior-package-field)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue