Stop recursing now that derivation deletion selection is smarter
As this probably won't help with performance.
This commit is contained in:
parent
47af6c9661
commit
d844b325e2
1 changed files with 9 additions and 32 deletions
|
|
@ -389,22 +389,6 @@ DELETE FROM derivation_output_details_sets
|
|||
WHERE id = $1"
|
||||
(list derivation-output-details-set-id)))))))
|
||||
|
||||
(let ((input-derivations
|
||||
(map car
|
||||
(exec-query
|
||||
conn
|
||||
"
|
||||
SELECT DISTINCT derivations.id
|
||||
FROM derivations
|
||||
WHERE derivations.id IN (
|
||||
SELECT derivation_outputs.derivation_id
|
||||
FROM derivation_outputs
|
||||
INNER JOIN derivation_inputs
|
||||
ON derivation_outputs.id = derivation_inputs.derivation_output_id
|
||||
WHERE derivation_inputs.derivation_id = $1
|
||||
)"
|
||||
(list id)))))
|
||||
|
||||
(exec-query
|
||||
conn
|
||||
"
|
||||
|
|
@ -417,14 +401,7 @@ DELETE FROM derivation_inputs WHERE derivation_id = $1"
|
|||
DELETE FROM derivations WHERE id = $1"
|
||||
(list id))
|
||||
|
||||
;; Look at the inputs to see if they can be deleted too, as one of
|
||||
;; the derivations that was using them has now been deleted.
|
||||
(fold
|
||||
(lambda (id result)
|
||||
(+ result
|
||||
(maybe-delete-derivation conn id)))
|
||||
1
|
||||
input-derivations)))))
|
||||
1)))
|
||||
|
||||
(with-postgresql-connection
|
||||
"data-deletion"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue