diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index 6d63de2..8e9067f 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -252,7 +252,8 @@ (lambda (conn) (with-statement-timeout conn - fetch-high-level-table-size-metrics)))) + fetch-high-level-table-size-metrics)) + #:timeout 3)) #:unwind? #t)) (guix-revisions-count (with-exception-handler @@ -268,7 +269,8 @@ (lambda (conn) (with-statement-timeout conn - count-guix-revisions)))) + count-guix-revisions)) + #:timeout 3)) #:unwind? #t)) (pg-stat-user-tables-metrics (with-exception-handler @@ -284,7 +286,8 @@ (lambda (conn) (with-statement-timeout conn - fetch-pg-stat-user-tables-metrics)))) + fetch-pg-stat-user-tables-metrics)) + #:timeout 3)) #:unwind? #t)) (pg-stat-user-indexes-metrics (with-exception-handler @@ -300,7 +303,8 @@ (lambda (conn) (with-statement-timeout conn - fetch-pg-stat-user-indexes-metrics)))) + fetch-pg-stat-user-indexes-metrics)) + #:timeout 3)) #:unwind? #t)) (pg-stats-metric-values (with-exception-handler @@ -316,7 +320,8 @@ (lambda (conn) (with-statement-timeout conn - fetch-pg-stats-metrics)))) + fetch-pg-stats-metrics)) + #:timeout 3)) #:unwind? #t)) (load-new-guix-revision-job-metrics (with-exception-handler @@ -332,10 +337,11 @@ (lambda (conn) (with-statement-timeout conn - select-load-new-guix-revision-job-metrics)))) + select-load-new-guix-revision-job-metrics)) + #:timeout 3)) #:unwind? #t))) - (for-each + (fibers-for-each (match-lambda ((name . pool) (for-each diff --git a/guix-data-service/web/server.scm b/guix-data-service/web/server.scm index 9782bd7..4db9839 100644 --- a/guix-data-service/web/server.scm +++ b/guix-data-service/web/server.scm @@ -223,6 +223,7 @@ port. Also, the port used can be changed by passing the --port option.\n" #:destructor (lambda (conn) (close-postgresql-connection conn "web-reserved")) + #:default-max-waiters postgresql-connections #:default-checkout-timeout 6 #:scheduler priority-scheduler)))