guix-commits
[Top][All Lists]
Advanced

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

02/02: services: guix-publish: Add 'cache-bypass-threshold' field.


From: guix-commits
Subject: 02/02: services: guix-publish: Add 'cache-bypass-threshold' field.
Date: Fri, 30 Oct 2020 07:33:26 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 2b2ab7796ac186d88060793b8873fc0e21462758
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Oct 30 12:31:18 2020 +0100

    services: guix-publish: Add 'cache-bypass-threshold' field.
    
    This is a followup to ecaa102a58ad3ab0b42e04a3d10d7c761c05ec98.
    
    * gnu/services/base.scm 
(<guix-publish-configuration>)[cache-bypass-threshold]:
    New field.
    (guix-publish-shepherd-service): Honor it.
---
 doc/guix.texi         |  6 ++++++
 gnu/services/base.scm | 10 ++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 2319bba..5e3e043 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15041,6 +15041,12 @@ When it is an integer, this is the number of worker 
threads used for
 caching; when @code{#f}, the number of processors is used.
 @xref{Invoking guix publish, @option{--workers}}, for more information.
 
+@item @code{cache-bypass-threshold} (default: 10 MiB)
+When @code{cache} is true, this is the maximum size in bytes of a store
+item for which @command{guix publish} may bypass its cache in case of a
+cache miss.  @xref{Invoking guix publish,
+@option{--cache-bypass-threshold}}, for more information.
+
 @item @code{ttl} (default: @code{#f})
 When it is an integer, this denotes the @dfn{time-to-live} in seconds
 of the published archives.  @xref{Invoking guix publish, @option{--ttl}},
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 07d9089..f1298c3 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1740,6 +1740,8 @@ proxy of 'guix-daemon'...~%")
                (default "nar"))
   (cache       guix-publish-configuration-cache   ;#f | string
                (default #f))
+  (cache-bypass-threshold guix-publish-configuration-cache-bypass-threshold
+                          (default (* 10 (expt 2 20)))) ;integer
   (workers     guix-publish-configuration-workers ;#f | integer
                (default #f))
   (ttl         guix-publish-configuration-ttl     ;#f | integer
@@ -1774,7 +1776,7 @@ raise a deprecation warning if the 'compression-level' 
field was used."
                    lst))))
 
   (match-record config <guix-publish-configuration>
-    (guix port host nar-path cache workers ttl)
+    (guix port host nar-path cache workers ttl cache-bypass-threshold)
     (list (shepherd-service
            (provision '(guix-publish))
            (requirement '(guix-daemon))
@@ -1796,7 +1798,11 @@ raise a deprecation warning if the 'compression-level' 
field was used."
                                                     "s"))
                                   #~())
                            #$@(if cache
-                                  #~((string-append "--cache=" #$cache))
+                                  #~((string-append "--cache=" #$cache)
+                                     #$(string-append
+                                        "--cache-bypass-threshold="
+                                        (number->string
+                                         cache-bypass-threshold)))
                                   #~()))
 
                      ;; Make sure we run in a UTF-8 locale so we can produce



reply via email to

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