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
1 changed files with 6 additions and 4 deletions
|
|
@ -33,11 +33,13 @@
|
||||||
|
|
||||||
(define (with-postgresql-connection paramstring f)
|
(define (with-postgresql-connection paramstring f)
|
||||||
(let* ((conn (connect-to-postgres-paramstring paramstring)))
|
(let* ((conn (connect-to-postgres-paramstring paramstring)))
|
||||||
(dynamic-wind
|
(with-throw-handler
|
||||||
(const #t)
|
#t
|
||||||
(lambda ()
|
|
||||||
(f conn))
|
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
(let ((result (f conn)))
|
||||||
|
(pg-conn-finish conn)
|
||||||
|
result))
|
||||||
|
(lambda (key . args)
|
||||||
(pg-conn-finish conn)))))
|
(pg-conn-finish conn)))))
|
||||||
|
|
||||||
(define (run-controller controller request body)
|
(define (run-controller controller request body)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue