mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 11:31:46 +00:00
Implemented safer temp cleanup and error reporting while fixing folded-directory size fallback to prevent double counting and aligning Homebrew cleanup traps with safe removal.
This commit is contained in:
@@ -471,11 +471,13 @@ func calculateDirSizeConcurrent(root string, largeFileChan chan<- fileEntry, duS
|
||||
defer func() { <-duSem }()
|
||||
return getDirectorySizeFromDu(path)
|
||||
}()
|
||||
if err == nil && size > 0 {
|
||||
atomic.AddInt64(&total, size)
|
||||
if err != nil || size <= 0 {
|
||||
size = calculateDirSizeFast(path, filesScanned, dirsScanned, bytesScanned, currentPath)
|
||||
} else {
|
||||
atomic.AddInt64(bytesScanned, size)
|
||||
atomic.AddInt64(dirsScanned, 1)
|
||||
}
|
||||
atomic.AddInt64(&total, size)
|
||||
atomic.AddInt64(dirsScanned, 1)
|
||||
}(fullPath)
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user