Actually close database connections
Previously, the connections were not closed, so eventually PostgreSQL would run out. Using a pool of connections would be better, but as a short term solution, just close the connection after each request.
This commit is contained in:
parent
5a9262b38d
commit
0a49c0a84a
2 changed files with 21 additions and 6 deletions
|
|
@ -50,9 +50,7 @@
|
|||
;; (render-html (error-page message))))
|
||||
)
|
||||
|
||||
(define (controller request body)
|
||||
(define conn (connect-to-postgres-paramstring "dbname=guix_data_service"))
|
||||
|
||||
(define (controller request body conn)
|
||||
(match-lambda
|
||||
((GET)
|
||||
(apply render-html (index (most-recent-n-guix-revisions conn 10))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue