fixed one more from copilot

This commit is contained in:
christophe-duc 2026-01-07 20:28:20 -04:00
parent 5e5dad8721
commit 6f74dea8ed
2 changed files with 6 additions and 0 deletions

View file

@ -175,6 +175,9 @@ func (c *Container) eraseOldHistory(maxDuration time.Duration) {
return
}
}
// All entries are older than maxDuration, clear the history
c.StatHistory = nil
}
func (c *Container) GetLastStats() (*RecordedStats, bool) {

View file

@ -69,6 +69,9 @@ func (p *Pod) eraseOldHistory(maxDuration time.Duration) {
return
}
}
// All entries are older than maxDuration, clear the history
p.StatHistory = nil
}
// GetLastStats returns the most recent stats entry.