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'.
This commit is contained in:
parent
87b711d200
commit
40cc850aeb
|
@ -411,17 +411,11 @@
|
||||||
(object->string %content-addressed-mirrors)))
|
(object->string %content-addressed-mirrors)))
|
||||||
|
|
||||||
(define built-in-builders*
|
(define built-in-builders*
|
||||||
(let ((cache (make-weak-key-hash-table)))
|
(let ((proc (store-lift built-in-builders)))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
"Return, as a monadic value, the list of built-in builders supported by
|
"Return, as a monadic value, the list of built-in builders supported by
|
||||||
the daemon."
|
the daemon; cache the return value."
|
||||||
(lambda (store)
|
(mcached (proc) built-in-builders))))
|
||||||
;; 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)))))
|
|
||||||
|
|
||||||
(define* (built-in-download file-name url
|
(define* (built-in-download file-name url
|
||||||
#:key system hash-algo hash
|
#:key system hash-algo hash
|
||||||
|
|
Loading…
Reference in New Issue