mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-06-04 23:12:47 +00:00
Compare commits
1 Commits
ref-cache-
...
ref-webi-g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23064a6db7 |
@@ -332,14 +332,13 @@ func (wc *WebiCache) stalest(packages []pkgConf) []pkgConf {
|
|||||||
for _, pkg := range packages {
|
for _, pkg := range packages {
|
||||||
data, err := wc.Store.Load(ctx, pkg.name)
|
data, err := wc.Store.Load(ctx, pkg.name)
|
||||||
var t time.Time
|
var t time.Time
|
||||||
hasAssets := false
|
|
||||||
if err == nil && data != nil {
|
if err == nil && data != nil {
|
||||||
t = data.UpdatedAt
|
t = data.UpdatedAt
|
||||||
hasAssets = len(data.Assets) > 0
|
|
||||||
}
|
}
|
||||||
// Never fetched, or has no assets despite having a timestamp
|
// Never fetched, or older than 10 minutes.
|
||||||
// (e.g. classified from empty rawcache), or older than 10 minutes.
|
// 0-asset results are not treated as perpetually stale — packages that
|
||||||
if t.IsZero() || !hasAssets || time.Since(t) > 10*time.Minute {
|
// 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})
|
stale = append(stale, stamped{pkg: pkg, updatedAt: t})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user