aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web/build-server/controller.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-data-service/web/build-server/controller.scm')
-rw-r--r--guix-data-service/web/build-server/controller.scm32
1 files changed, 15 insertions, 17 deletions
diff --git a/guix-data-service/web/build-server/controller.scm b/guix-data-service/web/build-server/controller.scm
index ca03284..911e41d 100644
--- a/guix-data-service/web/build-server/controller.scm
+++ b/guix-data-service/web/build-server/controller.scm
@@ -121,23 +121,21 @@
(define (spawn-fiber-for-handler handler)
(spawn-fiber
(lambda ()
- (with-postgresql-connection
- "build-event-handler-conn"
- (lambda (conn)
- (with-exception-handler
- (lambda (exn)
- (simple-format
- (current-error-port)
- "exception in build event handler: ~A\n"
- exn))
- (lambda ()
- (with-throw-handler #t
- (lambda ()
- (handler conn))
- (lambda _
- (display (backtrace) (current-error-port))
- (display "\n" (current-error-port)))))
- #:unwind? #t))))))
+ (with-resource-from-pool (connection-pool) conn
+ (with-exception-handler
+ (lambda (exn)
+ (simple-format
+ (current-error-port)
+ "exception in build event handler: ~A\n"
+ exn))
+ (lambda ()
+ (with-throw-handler #t
+ (lambda ()
+ (handler conn))
+ (lambda _
+ (display (backtrace) (current-error-port))
+ (display "\n" (current-error-port)))))
+ #:unwind? #t)))))
(define (with-build-ids-for-status data
build-ids