summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/db/bundb/bundb.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/db/bundb/bundb.go b/internal/db/bundb/bundb.go
index 45607ea15..b5d3ff003 100644
--- a/internal/db/bundb/bundb.go
+++ b/internal/db/bundb/bundb.go
@@ -401,6 +401,18 @@ func maxOpenConns() int {
if multiplier < 1 {
return 1
}
+
+ // Specifically for SQLite databases with
+ // a journal mode of anything EXCEPT "wal",
+ // only 1 concurrent connection is supported.
+ if strings.ToLower(config.GetDbType()) == "sqlite" {
+ journalMode := config.GetDbSqliteJournalMode()
+ journalMode = strings.ToLower(journalMode)
+ if journalMode != "wal" {
+ return 1
+ }
+ }
+
return multiplier * runtime.GOMAXPROCS(0)
}