🎨 退出时自动删除超过 7 天的安装包 Fix https://github.com/siyuan-note/siyuan/issues/6128

This commit is contained in:
Liang Ding 2022-10-10 10:00:24 +08:00
parent 3a1d8de0a3
commit 890bc3188d
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -614,10 +614,10 @@ func clearWorkspaceTemp() {
os.RemoveAll(filepath.Join(util.TempDir, "repo"))
os.RemoveAll(filepath.Join(util.TempDir, "os"))
// 退出时自动删除超过 30 天的安装包 https://github.com/siyuan-note/siyuan/issues/5957
// 退出时自动删除超过 7 天的安装包 https://github.com/siyuan-note/siyuan/issues/6128
install := filepath.Join(util.TempDir, "install")
if gulu.File.IsDir(install) {
monthAgo := time.Now().Add(-time.Hour * 24 * 30)
monthAgo := time.Now().Add(-time.Hour * 24 * 7)
entries, err := os.ReadDir(install)
if nil != err {
logging.LogErrorf("read dir [%s] failed: %s", install, err)