fix(task): revert to context based approach and fix tasks stuck, improve error handling

This commit is contained in:
yusing
2025-05-26 00:32:59 +08:00
parent 2e9f113224
commit 216c03c5ff
11 changed files with 200 additions and 183 deletions

View File

@@ -155,10 +155,11 @@ func (p *Poller[T, AggregateT]) Start() {
gatherErrsTicker.Stop()
saveTicker.Stop()
if err := p.save(); err != nil {
err := p.save()
if err != nil {
l.Err(err).Msg("failed to save metrics data")
}
t.Finish(nil)
t.Finish(err)
}()
l.Debug().Dur("interval", pollInterval).Msg("Starting poller")