mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-25 00:06:46 +00:00
Upgrade reports before caching
This change will reduces upgrades, since `report.Upgrade` only performs an upgrade if necessary.
This commit is contained in:
@@ -284,6 +284,7 @@ func (c *awsCollector) getReports(ctx context.Context, reportKeys []string) ([]r
|
||||
log.Warningf("Error fetching from cache: %v", err)
|
||||
}
|
||||
for key, report := range found {
|
||||
report = report.Upgrade()
|
||||
c.inProcess.StoreReport(key, report)
|
||||
reports = append(reports, report)
|
||||
}
|
||||
@@ -337,7 +338,7 @@ func (c *awsCollector) Report(ctx context.Context, timestamp time.Time) (report.
|
||||
return report.MakeReport(), err
|
||||
}
|
||||
|
||||
return c.merger.Merge(reports).Upgrade(), nil
|
||||
return c.merger.Merge(reports), nil
|
||||
}
|
||||
|
||||
func (c *awsCollector) HasHistoricReports() bool {
|
||||
|
||||
Reference in New Issue
Block a user