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.SetMaxOpenConns(maxConns)
|
||||||
|
sqlDB.SetMaxIdleConns(maxConns)
|
||||||
|
|
||||||
for _, pragma := range pragmas {
|
for _, pragma := range pragmas {
|
||||||
if _, err := sqlDB.Exec("PRAGMA " + pragma); err != nil {
|
if _, err := sqlDB.Exec("PRAGMA " + pragma); err != nil {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
maxDBConns = 16
|
maxDBConns = 6
|
||||||
minDeleteRetention = 24 * time.Hour
|
minDeleteRetention = 24 * time.Hour
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user