From ef2516fd4d87d6ffe9bc49e12f5bd222fc644cd2 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Tue, 18 Jul 2023 06:37:56 +0000 Subject: [PATCH] close db connections explicitly without this, sqlite3 was running out of file handles. --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index 30e10e7..ea17134 100644 --- a/main.go +++ b/main.go @@ -61,6 +61,7 @@ func main() { c.String(http.StatusInternalServerError, "oh no.") return } + defer db.Close() id, err := rand.Int(rand.Reader, randMax) if err != nil {