mirror of
https://github.com/syncthing/syncthing.git
synced 2026-03-24 17:21:56 -04:00
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 <jakob@kastelo.net>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
maxDBConns = 16
|
||||
maxDBConns = 6
|
||||
minDeleteRetention = 24 * time.Hour
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user