feat(rescan): limit rescans to active packages and run them in parallel

security.rescan_active_window skips packages not requested within the
window. security.rescan_concurrency runs a bounded pool of scans per
cycle. The cycle summary reports skips by reason. Both options default
to the previous behaviour.
This commit is contained in:
2026-11-23 19:26:10 +00:00
parent d6044cdd2e
commit 41f8369c43
5 changed files with 241 additions and 109 deletions
+4 -1
View File
@@ -320,7 +320,10 @@ func (a *App) initializeComponents() error {
// Initialize rescan worker if enabled
if a.config.Security.Enabled && a.config.Security.RescanInterval > 0 {
log.Info().Dur("interval", a.config.Security.RescanInterval).Msg("Initializing package rescan worker")
a.rescanWorker = scanner.NewRescanWorker(a.scanManager, a.metadata, a.config.Security.RescanInterval)
a.rescanWorker = scanner.NewRescanWorker(a.scanManager, a.metadata, a.config.Security.RescanInterval,
scanner.WithActiveWindow(a.config.Security.RescanActiveWindow),
scanner.WithConcurrency(a.config.Security.RescanConcurrency),
)
}
// Initialize WebSocket server