aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-10-01 19:14:11 +0100
committerChristopher Baines <mail@cbaines.net>2020-10-01 19:14:11 +0100
commitfb4c7ecd4cd4ff02b8244ce5ee98e1a39e0a133f (patch)
treefbd44f86f7d2f64ce223d8e90209f1ac063d6f70
parent614f9888a58fbd7b2e708cbbf0262f3eb42d2d49 (diff)
downloaddata-service-fb4c7ecd4cd4ff02b8244ce5ee98e1a39e0a133f.tar
data-service-fb4c7ecd4cd4ff02b8244ce5ee98e1a39e0a133f.tar.gz
Delete derivations through a channel
Not much different from before, but this will allow parallelising things.
-rw-r--r--guix-data-service/data-deletion.scm9
1 files 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