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:
authorHo3ein <ho3ein.sanaei@gmail.com>2023-12-10 17:42:52 +0300
committerGitHub <noreply@github.com>2023-12-10 17:42:52 +0300
commite3f1d3c892a1af48f27fdc36f273a55f38d13b40 (patch)
treeb11d0c1ed3c15c8f6f891a5e6df8e021d5db8ab6 /database
parent36cf7c0a8fda915b51e75958ce729fd9a61a5c90 (diff)
parent9fbe80f87f950673058f0001b3704251fa8b9243 (diff)
huge changes
Diffstat (limited to 'database')
-rw-r--r--database/db.go9
-rw-r--r--database/model/model.go1
2 files changed, 10 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
+}
diff --git a/database/model/model.go b/database/model/model.go
index 087e8b07..c9f9c105 100644
--- a/database/model/model.go
+++ b/database/model/model.go
@@ -83,4 +83,5 @@ type Client struct {
Enable bool `json:"enable" form:"enable"`
TgID string `json:"tgId" form:"tgId"`
SubID string `json:"subId" form:"subId"`
+ Reset int `json:"reset" form:"reset"`
}