mirror of
https://github.com/syncthing/syncthing.git
synced 2026-05-19 06:08:57 -04:00
fix(db): only vacuum database on startup when a migration script was actually run (#10339)
This commit is contained in:
committed by
GitHub
parent
4986fc1676
commit
6e9ccf7211
@@ -110,6 +110,7 @@ func openBase(path string, maxConns int, pragmas, schemaScripts, migrationScript
|
||||
}
|
||||
if int(n) > ver.SchemaVersion {
|
||||
slog.Info("Applying database migration", slogutil.FilePath(db.baseName), slog.String("script", scr))
|
||||
shouldVacuum = true
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -118,7 +119,6 @@ func openBase(path string, maxConns int, pragmas, schemaScripts, migrationScript
|
||||
if err := db.runScripts(tx, script, filter); err != nil {
|
||||
return nil, wrap(err)
|
||||
}
|
||||
shouldVacuum = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user