store: Record cache lookups in 'references/cached'.

* guix/store.scm (references/cached): Add call to
'record-cache-lookup!'.
This commit is contained in:
Ludovic Courtès 2022-05-29 22:58:56 +02:00
parent 98e2f4fbeb
commit 40530ffd15
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

@ -1840,8 +1840,10 @@ This is a mutating version that should be avoided. Prefer the functional
(define (references/cached store item)
"Like 'references', but cache results."
(let ((cache (store-connection-cache store %reference-cache-id)))
(match (vhash-assoc item cache)
(let* ((cache (store-connection-cache store %reference-cache-id))
(value (vhash-assoc item cache)))
(record-cache-lookup! %reference-cache-id value cache)
(match value
((_ . references)
references)
(#f