Move backfilling in to the server module and use the connection pool

To avoid using the old PostgreSQL connection per thread code.
This commit is contained in:
Christopher Baines 2024-04-01 21:51:29 +01:00
parent 5f5b8fc91d
commit b5f59189e1
3 changed files with 19 additions and 24 deletions

View file

@ -35,6 +35,7 @@
#:use-module (guix-data-service database)
#:use-module (guix-data-service web controller)
#:use-module (guix-data-service web util)
#:use-module (guix-data-service model guix-revision-package-derivation)
#:export (%guix-data-service-metrics-registry
start-guix-data-service-web-server))
@ -120,6 +121,12 @@
(resource-pool-default-timeout 5))
(spawn-fiber
(lambda ()
(with-resource-from-pool (connection-pool) conn
(backfill-guix-revision-package-derivation-distribution-counts
conn))))
(let ((render-metrics
(make-render-metrics registry)))