From 23064a6db7088dc5a06739ecc945fd0a12d9147b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 16 May 2026 21:53:01 -0600 Subject: [PATCH] fix(webicached): don't treat 0-asset packages as perpetually stale Packages that produce no classifiable assets (e.g. mariadb-galera with the galera asset_filter) were being refetched every batch because !hasAssets marked them stale regardless of timestamp. The hasAssets condition was intended for the startup case (classified from empty rawcache), but those packages are already caught by t.IsZero() on first run. Respect the timestamp for 0-asset results as for any other package. --- cmd/webicached/main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/webicached/main.go b/cmd/webicached/main.go index fa20978..d88bcdc 100644 --- a/cmd/webicached/main.go +++ b/cmd/webicached/main.go @@ -332,14 +332,13 @@ func (wc *WebiCache) stalest(packages []pkgConf) []pkgConf { for _, pkg := range packages { data, err := wc.Store.Load(ctx, pkg.name) var t time.Time - hasAssets := false if err == nil && data != nil { t = data.UpdatedAt - hasAssets = len(data.Assets) > 0 } - // Never fetched, or has no assets despite having a timestamp - // (e.g. classified from empty rawcache), or older than 10 minutes. - if t.IsZero() || !hasAssets || time.Since(t) > 10*time.Minute { + // Never fetched, or older than 10 minutes. + // 0-asset results are not treated as perpetually stale — packages that + // produce no classifiable assets (e.g. galera) respect the timestamp. + if t.IsZero() || time.Since(t) > 10*time.Minute { stale = append(stale, stamped{pkg: pkg, updatedAt: t}) } }