🐛 Fix clean unused assets stat https://github.com/siyuan-note/siyuan/issues/13096
This commit is contained in:
parent
77f96529e4
commit
01415b4821
1 changed files with 6 additions and 1 deletions
|
@ -525,7 +525,12 @@ func RemoveUnusedAssets() (ret []string) {
|
|||
if filelock.IsExist(absPath) {
|
||||
info, statErr := os.Stat(absPath)
|
||||
if statErr == nil {
|
||||
size += info.Size()
|
||||
if info.IsDir() {
|
||||
dirSize, _ := util.SizeOfDirectory(absPath)
|
||||
size += dirSize
|
||||
} else {
|
||||
size += info.Size()
|
||||
}
|
||||
}
|
||||
|
||||
if err := filelock.Remove(absPath); err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue