[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/06: download: 'built-in-builders*' relies on the functional cache.
From: |
guix-commits |
Subject: |
05/06: download: 'built-in-builders*' relies on the functional cache. |
Date: |
Wed, 19 Dec 2018 18:09:43 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 40cc850aebb497faed0a11d867d8fcee729023df
Author: Ludovic Courtès <address@hidden>
Date: Mon Jun 26 23:09:39 2017 +0200
download: 'built-in-builders*' relies on the functional cache.
The previous caching strategy, which used STORE as an 'eq?' key, would
no longer work when the functional cache is used because subsequent
store values are not 'eq?'.
* guix/download.scm (built-in-builders*): Rewrite in terms of
'mcached'.
---
guix/download.scm | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/guix/download.scm b/guix/download.scm
index a7f51b1..25eaefc 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -411,17 +411,11 @@
(object->string %content-addressed-mirrors)))
(define built-in-builders*
- (let ((cache (make-weak-key-hash-table)))
+ (let ((proc (store-lift built-in-builders)))
(lambda ()
"Return, as a monadic value, the list of built-in builders supported by
-the daemon."
- (lambda (store)
- ;; Memoize the result to avoid repeated RPCs.
- (values (or (hashq-ref cache store)
- (let ((result (built-in-builders store)))
- (hashq-set! cache store result)
- result))
- store)))))
+the daemon; cache the return value."
+ (mcached (proc) built-in-builders))))
(define* (built-in-download file-name url
#:key system hash-algo hash
- branch master updated (207a79b -> 9012d22), guix-commits, 2018/12/19
- 01/06: store: Add 'GUIX_PROFILING' support for the object cache., guix-commits, 2018/12/19
- 03/06: packages: Turn 'cache!' into a single-value-return cache., guix-commits, 2018/12/19
- 02/06: Use 'mapm' instead of 'sequence' + 'map'., guix-commits, 2018/12/19
- 04/06: utils: Memoize 'absolute-dirname'., guix-commits, 2018/12/19
- 05/06: download: 'built-in-builders*' relies on the functional cache.,
guix-commits <=
- 06/06: services: zabbix-front-end: Tweak error and hint messages., guix-commits, 2018/12/19