Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-09-26 00:14:23 +08:00
commit 4793833f61
4 changed files with 24 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@ require (
github.com/88250/css v0.1.2
github.com/88250/flock v0.8.2
github.com/88250/gulu v1.2.3-0.20220916075322-eb117059d70a
github.com/88250/lute v1.7.5-0.20220925035655-a9e57528aaf4
github.com/88250/lute v1.7.5-0.20220925154756-852439eedbcd
github.com/88250/pdfcpu v0.3.13
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732

View File

@ -21,6 +21,8 @@ github.com/88250/gulu v1.2.3-0.20220916075322-eb117059d70a h1:qQdnk8clbgA+MXtf5b
github.com/88250/gulu v1.2.3-0.20220916075322-eb117059d70a/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
github.com/88250/lute v1.7.5-0.20220925035655-a9e57528aaf4 h1:3PjuHFHWOMYKjfQnStNBULt4NzAATMYLDzehzoVaSxk=
github.com/88250/lute v1.7.5-0.20220925035655-a9e57528aaf4/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20220925154756-852439eedbcd h1:LhCa7xryyJLTHHVJwVQ3IvzFjAe1M05h0UiSWDATl30=
github.com/88250/lute v1.7.5-0.20220925154756-852439eedbcd/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=
github.com/88250/pdfcpu v0.3.13/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View File

@ -570,6 +570,25 @@ 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
install := filepath.Join(util.TempDir, "install")
if gulu.File.IsDir(install) {
monthAgo := time.Now().Add(-time.Hour * 24 * 30)
entries, err := os.ReadDir(install)
if nil != err {
logging.LogErrorf("read dir [%s] failed: %s", install, err)
} else {
for _, entry := range entries {
info, _ := entry.Info()
if nil != info && !info.IsDir() && info.ModTime().Before(monthAgo) {
if err = os.RemoveAll(filepath.Join(install, entry.Name())); nil != err {
logging.LogErrorf("remove old install pkg [%s] failed: %s", filepath.Join(install, entry.Name()), err)
}
}
}
}
}
tmps, err := filepath.Glob(filepath.Join(util.TempDir, "*.tmp"))
if nil != err {
logging.LogErrorf("glob temp files failed: %s", err)