Use the connection pool for build events
I'm not sure why this wasn't the way it worked previously. This should avoid unconstrained use of PostgreSQL connections.
This commit is contained in:
parent
9f102dbd39
commit
f2e2ca7a07
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue