guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: guix-commits
Subject: 01/05: store: Record cache lookups in 'references/cached'.
Date: Sun, 29 May 2022 17:59:30 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 40530ffd15ece6ec610a43221293010fe3b9234b
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun May 29 22:58:56 2022 +0200

    store: Record cache lookups in 'references/cached'.
    
    * guix/store.scm (references/cached): Add call to
    'record-cache-lookup!'.
---
 guix/store.scm | 6 ++++--
 1 file 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]