[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/05: Delete derivations through a channel
From: |
Christopher Baines |
Subject: |
03/05: Delete derivations through a channel |
Date: |
Thu, 1 Oct 2020 14:16:44 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit fb4c7ecd4cd4ff02b8244ce5ee98e1a39e0a133f
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Oct 1 19:14:11 2020 +0100
Delete derivations through a channel
Not much different from before, but this will allow parallelising things.
---
guix-data-service/data-deletion.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/guix-data-service/data-deletion.scm
b/guix-data-service/data-deletion.scm
index 6c2ab78..2672292 100644
--- a/guix-data-service/data-deletion.scm
+++ b/guix-data-service/data-deletion.scm
@@ -19,6 +19,7 @@
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:use-module (squee)
+ #:use-module (guix-data-service utils)
#:use-module (guix-data-service database)
#:use-module (guix-data-service model
package-derivation-by-guix-revision-range)
#:export (delete-data-for-branch
@@ -393,6 +394,10 @@ DELETE FROM derivations WHERE id = $1"
1)))
+ (define conn-channel
+ (make-postgresql-connection-channel
+ "data-deletion-thread"))
+
(with-postgresql-connection
"data-deletion"
(lambda (conn)
@@ -437,8 +442,8 @@ WHERE NOT EXISTS (
1))
result))
(+ result
- (with-postgresql-transaction
- conn
+ (with-postgresql-transaction/through-channel
+ conn-channel
(lambda (conn)
(exec-query
conn