Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'database/db.go')
-rw-r--r--database/db.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/database/db.go b/database/db.go
index aaeb8bd9..8bd0fb49 100644
--- a/database/db.go
+++ b/database/db.go
@@ -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
+}