aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-01-18 14:42:48 +0000
committerChristopher Baines <mail@cbaines.net>2024-01-18 14:42:48 +0000
commit6842a432d668f3e42de0b416813f359beef9ae6f (patch)
tree23c435cd5721ab908c4e0b42b28ccda0fd9c1674 /guix-data-service
parente51f87cc7ea0b38254a8b1a01c83c6b8f6173812 (diff)
downloaddata-service-6842a432d668f3e42de0b416813f359beef9ae6f.tar
data-service-6842a432d668f3e42de0b416813f359beef9ae6f.tar.gz
Split and instrument parts of inferior-packages->package-metadata-ids
As parts of it are slow.
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/model/package-metadata.scm51
1 files changed, 29 insertions, 22 deletions
diff --git a/guix-data-service/model/package-metadata.scm b/guix-data-service/model/package-metadata.scm
index 4372d8f..aaaee68 100644
--- a/guix-data-service/model/package-metadata.scm
+++ b/guix-data-service/model/package-metadata.scm
@@ -400,28 +400,35 @@ WHERE packages.id IN (
package_description_set_id
package_synopsis_set_id)
- (map (match-lambda*
- (((home-page
- location
- package-description-data
- package-synopsis-data)
- license-set-id)
-
- (list (if (string? home-page)
- home-page
- NULL)
- (location->location-id
- conn
- location)
- license-set-id
- (package-description-data->package-description-set-id
- conn
- package-description-data)
- (package-synopsis-data->package-synopsis-set-id
- conn
- package-synopsis-data))))
- package-metadata
- license-set-ids)
+ (zip
+ (map (match-lambda
+ ((home-page rest ...)
+ (if (string? home-page)
+ home-page
+ NULL)))
+ package-metadata)
+ (with-time-logging "preparing location ids"
+ (map (match-lambda
+ ((_ location rest ...)
+ (location->location-id
+ conn
+ location)))
+ package-metadata))
+ license-set-ids
+ (with-time-logging "preparing package description set ids"
+ (map (match-lambda
+ ((_ _ package-description-data _)
+ (package-description-data->package-description-set-id
+ conn
+ package-description-data)))
+ package-metadata))
+ (with-time-logging "preparing package synopsis set ids"
+ (map (match-lambda
+ ((_ _ _ package-synopsis-data)
+ (package-synopsis-data->package-synopsis-set-id
+ conn
+ package-synopsis-data)))
+ package-metadata)))
;; There can be duplicated entires in package-metadata, for example where
;; you have one package definition which interits from another, and just
;; overrides the version and the source, the package_metadata entries for