VACUUM db on close

This commit is contained in:
Jan-Lukas Else 2020-07-30 16:47:46 +02:00
parent 65ce24d410
commit c558f46e32
1 changed files with 7 additions and 0 deletions

View File

@ -26,5 +26,12 @@ func finishWritingToDb() {
}
func closeDb() error {
vacuumDb()
return appDb.Close()
}
func vacuumDb() {
startWritingToDb()
_, _ = appDb.Exec("VACUUM;")
finishWritingToDb()
}