From 7ad559f69aaf8b095cbaf6e7e013b5d1f0070151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=83=E9=9A=A8=E7=B7=A3=E5=8B=95?= Date: Sat, 20 Sep 2025 01:30:59 +0800 Subject: [PATCH] One-click configuration: Vless Encryption + XHTTP --- web/service/server.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/web/service/server.go b/web/service/server.go index 169fd6c6..c74fd429 100644 --- a/web/service/server.go +++ b/web/service/server.go @@ -975,14 +975,9 @@ func (s *ServerService) SaveLinkHistory(historyType, link string) error { Link: link, CreatedAt: time.Now(), } - // 【中文注释】: 调用数据库方法将记录写入 WAL 文件 - err := database.AddLinkHistory(record) - if err != nil { - return err - } - // 【中文注释】【新增代码】: 强制执行一次 Checkpoint 操作。 - // 【中文注释】: 确保 WAL 文件中的新数据被立即写入并持久化到主数据库文件中,从而解决刷新后数据丢失的问题。 - return database.Checkpoint() + // 【核心修正】: 直接调用 AddLinkHistory 并返回其结果。 + // 我们将把 Checkpoint 的逻辑移入 AddLinkHistory 内部,确保操作的原子性。 + return database.AddLinkHistory(record) } // LoadLinkHistory loads the latest 10 links from the database