aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2025-04-18 11:01:44 +0100
committerChristopher Baines <mail@cbaines.net>2025-04-18 11:01:44 +0100
commitfd2a3ad6c1621abf63a686c42030c8a5daf5f9b2 (patch)
treec969cc04ee590e7a0f096f2ad459e6df5b19d7f4
parent273a2127ed7fdfba2e9e4aba1a6da321d072d0b9 (diff)
downloaddata-service-fd2a3ad6c1621abf63a686c42030c8a5daf5f9b2.tar
data-service-fd2a3ad6c1621abf63a686c42030c8a5daf5f9b2.tar.gz
Clear the derivation-ids-hash-table when holding the db connection
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index 716e186..5abe945 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -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)