From b5f59189e17161b2396adf7b5440f04a2a8d5c01 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 1 Apr 2024 21:51:29 +0100 Subject: Move backfilling in to the server module and use the connection pool To avoid using the old PostgreSQL connection per thread code. --- guix-data-service/web/server.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guix-data-service/web') diff --git a/guix-data-service/web/server.scm b/guix-data-service/web/server.scm index 1c0bce1..b73b186 100644 --- a/guix-data-service/web/server.scm +++ b/guix-data-service/web/server.scm @@ -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))) -- cgit v1.2.3