Update DB WAL before backup

This commit is contained in:
Alireza Ahmadi
2023-12-08 01:26:51 +01:00
parent 5725420197
commit 03e1434051
3 changed files with 22 additions and 1 deletions

View File

@@ -110,3 +110,12 @@ func IsSQLiteDB(file io.Reader) (bool, error) {
}
return bytes.Equal(buf, signature), nil
}
func Checkpoint() error {
// Update WAL
err := db.Exec("PRAGMA wal_checkpoint;").Error
if err != nil {
return err
}
return nil
}