Fix healing probability for skipped folders (#20988)

We must update the heal probability when selectively skipping folders.
This commit is contained in:
Klaus Post 2025-02-28 01:55:16 -08:00 committed by GitHub
parent 4c71f1b4ec
commit 8c2c92f7af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -664,6 +664,12 @@ func (f *folderScanner) scanFolder(ctx context.Context, folder cachedFolder, int
into.addChild(h)
continue
}
// Adjust the probability of healing.
// This first removes lowest x from the mod check and makes it x times more likely.
// So if duudc = 10 and we want heal check every 50 cycles, we check
// if (cycle/10) % (50/10) == 0, which would make heal checks run once every 50 cycles,
// if the objects are pre-selected as 1:10.
folder.objectHealProbDiv = dataUsageUpdateDirCycles
}
f.updateCurrentPath(folder.name)
stopFn := globalScannerMetrics.log(scannerMetricScanFolder, f.root, folder.name)