From 18e04fc984b083bff1004200bbda8cb1cd72ae69 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 19 Dec 2025 11:40:15 +0100 Subject: Make sure to close DB --- gn/db/mysql.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gn/db/mysql.scm b/gn/db/mysql.scm index 623a726..8da7b60 100644 --- a/gn/db/mysql.scm +++ b/gn/db/mysql.scm @@ -37,9 +37,10 @@ ))) (define (call-with-db thunk) - (let [(db (db-open))] - (thunk db) - (dbi-close db))) + (let* [(db (db-open)) + (result (thunk db))] + (dbi-close db) + result)) (define (ensure db msg1) "Use DBI-style handle to report an error. On error the program will stop." -- cgit 1.4.1