mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 08:14:21 +01:00
🎨 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:
parent
a79d399f0a
commit
aa1893e3de
4 changed files with 38 additions and 3 deletions
|
|
@ -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"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue