Clear the derivation-ids-hash-table when holding the db connection

This commit is contained in:
Christopher Baines 2025-04-18 11:01:44 +01:00
parent 273a2127ed
commit fd2a3ad6c1

View file

@ -1265,8 +1265,11 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
(lambda ()
;; If this has happened because derivations have been removed, it
;; might be necessary to insert them in the database where they
;; previously existed
(hash-clear! derivation-ids-hash-table)
;; previously existed. Clear the hash table while having the
;; PostgreSQL connection to avoid issues with it being used at the
;; same time.
(with-resource-from-pool postgresql-connection-pool conn
(hash-clear! derivation-ids-hash-table))
(insert-input-derivations derivations))))))
(define (fix-derivation file-name)