mirror of
git://git.savannah.gnu.org/guix/data-service.git
synced 2023-12-14 03:23:03 +01:00
Switch dynamic-wind for with-throw-handler
Not sure why, but dynamic-wind was causing issues by closing the database connection too early, but with-throw-handler seems to work OK.
This commit is contained in:
parent
2b1142b424
commit
800c850276
|
@ -33,11 +33,13 @@
|
|||
|
||||
(define (with-postgresql-connection paramstring f)
|
||||
(let* ((conn (connect-to-postgres-paramstring paramstring)))
|
||||
(dynamic-wind
|
||||
(const #t)
|
||||
(lambda ()
|
||||
(f conn))
|
||||
(with-throw-handler
|
||||
#t
|
||||
(lambda ()
|
||||
(let ((result (f conn)))
|
||||
(pg-conn-finish conn)
|
||||
result))
|
||||
(lambda (key . args)
|
||||
(pg-conn-finish conn)))))
|
||||
|
||||
(define (run-controller controller request body)
|
||||
|
|
Loading…
Reference in a new issue