Enable sqlite WAL and busy timeout
This commit is contained in:
parent
d14080460e
commit
0f79b2a7e5
|
|
@ -33,7 +33,9 @@ func NewStateStore(path string) (*StateStore, error) {
|
|||
return nil, fmt.Errorf("create state store dir: %w", err)
|
||||
}
|
||||
|
||||
db, err := sql.Open("sqlite", path)
|
||||
// Enable WAL mode + busy timeout to reduce SQLITE_BUSY errors under concurrency.
|
||||
dsn := path + "?_pragma=busy_timeout(5000)&_pragma=journal_mode(WAL)"
|
||||
db, err := sql.Open("sqlite", dsn)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("open state store: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue