1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-05 21:58:01 +00:00

fix: avoid orphan service false positives and warm large file threshold

This commit is contained in:
Tw93
2026-01-23 20:16:06 +08:00
parent 500b6dc554
commit 83166f2fe8
3 changed files with 68 additions and 13 deletions

View File

@@ -3,18 +3,19 @@ package main
import "time"
const (
maxEntries = 30
maxLargeFiles = 20
barWidth = 24
spotlightMinFileSize = 100 << 20
defaultViewport = 12
overviewCacheTTL = 7 * 24 * time.Hour
overviewCacheFile = "overview_sizes.json"
duTimeout = 30 * time.Second
mdlsTimeout = 5 * time.Second
maxConcurrentOverview = 8
batchUpdateSize = 100
cacheModTimeGrace = 30 * time.Minute
maxEntries = 30
maxLargeFiles = 20
barWidth = 24
spotlightMinFileSize = 100 << 20
largeFileWarmupMinSize = 1 << 20
defaultViewport = 12
overviewCacheTTL = 7 * 24 * time.Hour
overviewCacheFile = "overview_sizes.json"
duTimeout = 30 * time.Second
mdlsTimeout = 5 * time.Second
maxConcurrentOverview = 8
batchUpdateSize = 100
cacheModTimeGrace = 30 * time.Minute
// Worker pool limits.
minWorkers = 16

View File

@@ -37,7 +37,7 @@ func scanPathConcurrent(root string, filesScanned, dirsScanned, bytesScanned *in
largeFilesHeap := &largeFileHeap{}
heap.Init(largeFilesHeap)
largeFileMinSize := int64(0)
largeFileMinSize := int64(largeFileWarmupMinSize)
// Worker pool sized for I/O-bound scanning.
numWorkers := max(runtime.NumCPU()*cpuMultiplier, minWorkers)