mirror of
git://git.savannah.gnu.org/guix/data-service.git
synced 2023-12-14 03:23:03 +01:00
Remove redundant postgresql connection when deleting derivations
This commit is contained in:
parent
ebbcf36dc4
commit
1266d3d336
1 changed files with 46 additions and 47 deletions
|
@ -512,9 +512,6 @@ DELETE FROM derivations WHERE id = $1"
|
|||
|
||||
1)))
|
||||
|
||||
(with-postgresql-connection
|
||||
"data-deletion"
|
||||
(lambda (conn)
|
||||
(define (delete-batch conn)
|
||||
(let* ((derivations
|
||||
(with-time-logging "fetching batch of derivations"
|
||||
|
@ -586,6 +583,8 @@ SET CONSTRAINTS derivations_by_output_details_set_derivation_id_fkey DEFERRED")
|
|||
(lambda ()
|
||||
(run-fibers
|
||||
(lambda ()
|
||||
(with-thread-postgresql-connection
|
||||
(lambda (conn)
|
||||
(let loop ((total-deleted 0))
|
||||
(let ((batch-deleted-count (delete-batch conn)))
|
||||
(if (eq? 0 batch-deleted-count)
|
||||
|
|
Loading…
Reference in a new issue