1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-14 20:32:28 +00:00

optimize analyze scanner concurrency and channel send semantics

This commit is contained in:
tw93
2026-02-10 16:23:24 +08:00
parent 7d8bfbc9d9
commit 1a559f8563
2 changed files with 87 additions and 54 deletions

View File

@@ -220,11 +220,7 @@ func (m model) View() string {
if entry.IsDir && isCleanableDir(entry.Path) {
hintLabel = fmt.Sprintf("%s🧹%s", colorYellow, colorReset)
} else {
lastAccess := entry.LastAccess
if lastAccess.IsZero() && entry.Path != "" {
lastAccess = getLastAccessTime(entry.Path)
}
if unusedTime := formatUnusedTime(lastAccess); unusedTime != "" {
if unusedTime := formatUnusedTime(entry.LastAccess); unusedTime != "" {
hintLabel = fmt.Sprintf("%s%s%s", colorGray, unusedTime, colorReset)
}
}
@@ -309,11 +305,7 @@ func (m model) View() string {
if entry.IsDir && isCleanableDir(entry.Path) {
hintLabel = fmt.Sprintf("%s🧹%s", colorYellow, colorReset)
} else {
lastAccess := entry.LastAccess
if lastAccess.IsZero() && entry.Path != "" {
lastAccess = getLastAccessTime(entry.Path)
}
if unusedTime := formatUnusedTime(lastAccess); unusedTime != "" {
if unusedTime := formatUnusedTime(entry.LastAccess); unusedTime != "" {
hintLabel = fmt.Sprintf("%s%s%s", colorGray, unusedTime, colorReset)
}
}