mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
@@ -680,7 +680,15 @@ func clearOutdatedHistoryDir(historyDir string) {
|
||||
logging.LogErrorf("read history dir [%s] failed: %s", dir.Name(), err)
|
||||
continue
|
||||
}
|
||||
if dirInfo.ModTime().Unix() < ago {
|
||||
|
||||
var nameTime int64
|
||||
if dirName := dirInfo.Name(); len(dirName) > len("2006-01-02-150405") {
|
||||
if t, parseErr := time.Parse("2006-01-02-150405", dirName[:len("2006-01-02-150405")]); nil == parseErr {
|
||||
nameTime = t.Unix()
|
||||
}
|
||||
}
|
||||
|
||||
if dirInfo.ModTime().Unix() < ago || (0 != nameTime && nameTime < ago) {
|
||||
removes = append(removes, filepath.Join(historyDir, dir.Name()))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user