🎨 Supports cleaning up unreferenced databases https://github.com/siyuan-note/siyuan/issues/11569

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-29 22:55:24 +08:00
parent a79d399f0a
commit aa1893e3de
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 38 additions and 3 deletions

View file

@ -426,6 +426,24 @@ func RollbackNotebookHistory(historyPath string) (err error) {
return nil
}
func RollbackAttributeViewHistory(historyPath string) (err error) {
if !gulu.File.IsExist(historyPath) {
logging.LogWarnf("av history [%s] not exist", historyPath)
return
}
from := historyPath
to := filepath.Join(util.DataDir, "storage", "av", filepath.Base(historyPath))
if err = filelock.CopyNewtimes(from, to); err != nil {
logging.LogErrorf("copy file [%s] to [%s] failed: %s", from, to, err)
return
}
IncSync()
util.PushMsg(Conf.Language(102), 3000)
return nil
}
type History struct {
HCreated string `json:"hCreated"`
Items []*HistoryItem `json:"items"`