From 9ffce6e3ff60ea615c81585dac5eac85de98bb58 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Fri, 13 Mar 2026 13:03:22 +0100 Subject: [PATCH] chore(sqlite): reduce max open connections, keep them open permanently (fixes #10592) (#10596) chore(sqlite): reduce max open connections, keep them open permanently (fixes #10592) Reduces connection churn, possibly tickling concurrency bug on Windows. Signed-off-by: Jakob Borg --- internal/db/sqlite/basedb.go | 1 + internal/db/sqlite/db_open.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/db/sqlite/basedb.go b/internal/db/sqlite/basedb.go index 2058fde88..0b9f3f1d6 100644 --- a/internal/db/sqlite/basedb.go +++ b/internal/db/sqlite/basedb.go @@ -63,6 +63,7 @@ func openBase(path string, maxConns int, pragmas, schemaScripts, migrationScript } sqlDB.SetMaxOpenConns(maxConns) + sqlDB.SetMaxIdleConns(maxConns) for _, pragma := range pragmas { if _, err := sqlDB.Exec("PRAGMA " + pragma); err != nil { diff --git a/internal/db/sqlite/db_open.go b/internal/db/sqlite/db_open.go index dcce4319a..0f55282cb 100644 --- a/internal/db/sqlite/db_open.go +++ b/internal/db/sqlite/db_open.go @@ -20,7 +20,7 @@ import ( ) const ( - maxDBConns = 16 + maxDBConns = 6 minDeleteRetention = 24 * time.Hour )