diff options
| author | Ho3ein <ho3ein.sanaei@gmail.com> | 2023-12-10 17:42:52 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-10 17:42:52 +0300 |
| commit | e3f1d3c892a1af48f27fdc36f273a55f38d13b40 (patch) | |
| tree | b11d0c1ed3c15c8f6f891a5e6df8e021d5db8ab6 /web/service/tgbot.go | |
| parent | 36cf7c0a8fda915b51e75958ce729fd9a61a5c90 (diff) | |
| parent | 9fbe80f87f950673058f0001b3704251fa8b9243 (diff) | |
huge changes
Diffstat (limited to 'web/service/tgbot.go')
| -rw-r--r-- | web/service/tgbot.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/service/tgbot.go b/web/service/tgbot.go index b54ceb1c..0847e418 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -9,6 +9,7 @@ import ( "strings" "time" "x-ui/config" + "x-ui/database" "x-ui/database/model" "x-ui/logger" "x-ui/util/common" @@ -1417,6 +1418,12 @@ func (t *Tgbot) sendBackup(chatId int64) { output := t.I18nBot("tgbot.messages.backupTime", "Time=="+time.Now().Format("2006-01-02 15:04:05")) t.SendMsgToTgbot(chatId, output) + // Update by manually trigger a checkpoint operation + err := database.Checkpoint() + if err != nil { + logger.Warning("Error in trigger a checkpoint operation: ", err) + } + file, err := os.Open(config.GetDBPath()) if err != nil { logger.Warning("Error in opening db file for backup: ", err) |
