summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-05-29 22:58:56 +0200
committerLudovic Courtès <ludo@gnu.org>2022-05-29 23:56:01 +0200
commit40530ffd15ece6ec610a43221293010fe3b9234b (patch)
treede7e0c5678343aa597f382cec3f2951c8fda5741
parent98e2f4fbebb8b08784401e2095123fcd3d3a32cb (diff)
downloadguix-patches-40530ffd15ece6ec610a43221293010fe3b9234b.tar
guix-patches-40530ffd15ece6ec610a43221293010fe3b9234b.tar.gz
store: Record cache lookups in 'references/cached'.
* guix/store.scm (references/cached): Add call to 'record-cache-lookup!'.
-rw-r--r--guix/store.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 82fca14cd9..efba07bdcd 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -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