mirror of
https://github.com/stashapp/stash.git
synced 2025-12-24 01:03:24 +01:00
Set NORMAL sync on sqlite3 (#1684)
NORMAL sync is safe when using WAL journaliing. It cuts the amount of sync calls to the disk, resulting in faster write operation. On power loss, the database will perhaps lose some ongoing commits, but that is all. The expectation is that if the database lives on the same disk as the stash, this could help performance quite a bit under heavier operation.
This commit is contained in:
parent
87709fd018
commit
b7c229dc70
1 changed files with 1 additions and 1 deletions
|
|
@ -98,7 +98,7 @@ func Close() error {
|
|||
|
||||
func open(databasePath string, disableForeignKeys bool) *sqlx.DB {
|
||||
// https://github.com/mattn/go-sqlite3
|
||||
url := "file:" + databasePath + "?_journal=WAL"
|
||||
url := "file:" + databasePath + "?_journal=WAL&_sync=NORMAL"
|
||||
if !disableForeignKeys {
|
||||
url += "&_fk=true"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue