diff options
author | Christopher Baines <mail@cbaines.net> | 2019-02-08 11:19:12 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-02-08 11:19:12 +0000 |
commit | 0a49c0a84af6fc95a6deba8584da7517b135abf2 (patch) | |
tree | 1d7132154680476f577b92341b5fe502e79840df /guix-data-service/web/controller.scm | |
parent | 5a9262b38d506008b21fd73eb8f7c3046b47de92 (diff) | |
download | data-service-0a49c0a84af6fc95a6deba8584da7517b135abf2.tar data-service-0a49c0a84af6fc95a6deba8584da7517b135abf2.tar.gz |
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.
Diffstat (limited to 'guix-data-service/web/controller.scm')
-rw-r--r-- | guix-data-service/web/controller.scm | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index 1d7bd72..7fc934a 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -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)))) |