One-click configuration: Vless Encryption + XHTTP
This commit is contained in:
parent
8afe6d3e14
commit
7ad559f69a
@ -975,14 +975,9 @@ func (s *ServerService) SaveLinkHistory(historyType, link string) error {
|
|||||||
Link: link,
|
Link: link,
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
}
|
}
|
||||||
// 【中文注释】: 调用数据库方法将记录写入 WAL 文件
|
// 【核心修正】: 直接调用 AddLinkHistory 并返回其结果。
|
||||||
err := database.AddLinkHistory(record)
|
// 我们将把 Checkpoint 的逻辑移入 AddLinkHistory 内部,确保操作的原子性。
|
||||||
if err != nil {
|
return database.AddLinkHistory(record)
|
||||||
return err
|
|
||||||
}
|
|
||||||
// 【中文注释】【新增代码】: 强制执行一次 Checkpoint 操作。
|
|
||||||
// 【中文注释】: 确保 WAL 文件中的新数据被立即写入并持久化到主数据库文件中,从而解决刷新后数据丢失的问题。
|
|
||||||
return database.Checkpoint()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadLinkHistory loads the latest 10 links from the database
|
// LoadLinkHistory loads the latest 10 links from the database
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user