guix-commits
[Top][All Lists]
Advanced

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

01/01: publish: Do not bake the same item several times.


From: Ludovic Courtès
Subject: 01/01: publish: Do not bake the same item several times.
Date: Wed, 24 May 2017 05:17:48 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 737397355cfcf604c8f72fa1ef8c8e321221a6fb
Author: Ludovic Courtès <address@hidden>
Date:   Wed May 24 10:51:34 2017 +0200

    publish: Do not bake the same item several times.
    
    Before this patch, there was a possibility that we'd queue several
    baking tasks for the same item.  The first one would bake the item but
    subsequent tasks wouldn't check whether the item had been baked in the
    meantime and would re-bake it.
    
    * guix/scripts/publish.scm (render-narinfo/cached): Don't call
    'bake-narinfo+nar' when (file-exists? cached).
---
 guix/scripts/publish.scm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index db7f6a9..c306b80 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -425,11 +425,13 @@ requested using POOL."
            ;; return 404.
            (eventually pool
              (single-baker item
-               ;; (format #t "baking ~s~%" item)
-               (bake-narinfo+nar cache item
-                                 #:ttl ttl
-                                 #:compression compression
-                                 #:nar-path nar-path))
+               ;; Check whether CACHED has been produced in the meantime.
+               (unless (file-exists? cached)
+                 ;; (format #t "baking ~s~%" item)
+                 (bake-narinfo+nar cache item
+                                   #:ttl ttl
+                                   #:compression compression
+                                   #:nar-path nar-path)))
 
              (when ttl
                (single-baker 'cache-cleanup



reply via email to

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