guix-commits
[Top][All Lists]
Advanced

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

04/04: Make the derivation deletion batch size configurable


From: Christopher Baines
Subject: 04/04: Make the derivation deletion batch size configurable
Date: Thu, 8 Oct 2020 02:53:02 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit 936fda57c5a20040b7b364867924d96b802c83bc
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Oct 8 07:52:03 2020 +0100

    Make the derivation deletion batch size configurable
---
 guix-data-service/data-deletion.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix-data-service/data-deletion.scm 
b/guix-data-service/data-deletion.scm
index c861d3a..04bae52 100644
--- a/guix-data-service/data-deletion.scm
+++ b/guix-data-service/data-deletion.scm
@@ -315,7 +315,8 @@ FROM (
 ) AS git_branches_latest_revision
 WHERE commit = ''")))))
 
-(define (delete-unreferenced-derivations)
+(define* (delete-unreferenced-derivations #:key
+                                          (batch-size 1000000))
   (define (delete-builds-for-derivation-output-details-set
            conn
            derivation-output-details-set-id)
@@ -479,7 +480,8 @@ WHERE NOT EXISTS (
 ) AND NOT EXISTS (
   SELECT 1 FROM guix_revision_system_test_derivations
   WHERE derivation_id = derivation_outputs.derivation_id
-) LIMIT 1000000")))
+) LIMIT $1"
+                     (list (number->string batch-size)))))
               (derivations-count (length derivations)))
          (simple-format (current-error-port)
                         "Looking at ~A derivations\n"



reply via email to

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