Update DB WAL before backup #1300

This commit is contained in:
Alireza Ahmadi committed 2023-12-08 20:35:10 +01:00
1 parent c980a06969
commit 6411facf6a
3 files changed
+21

No files matched your search

+9
View File
@@ -112,3 +112,12 @@ func IsSQLiteDB(file io.ReaderAt) (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
}