Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-26 13:33:00 +08:00
parent dc0b27e02b
commit 9b07a78b16
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -681,6 +681,11 @@ func clearOutdatedHistoryDir(historyDir string) {
continue
}
if dirInfo.ModTime().Unix() < ago {
removes = append(removes, filepath.Join(historyDir, dir.Name()))
continue
}
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 {
@ -688,7 +693,7 @@ func clearOutdatedHistoryDir(historyDir string) {
}
}
if dirInfo.ModTime().Unix() < ago || (0 != nameTime && nameTime < ago) {
if 0 != nameTime && nameTime < ago {
removes = append(removes, filepath.Join(historyDir, dir.Name()))
}
}