v0.15.5: Fix startup hub report — Push() returns real errors, startup retries 3x with 15s delay

This commit is contained in:
2026-02-19 10:08:43 +01:00
parent 925711e44e
commit 00c668fc92
3 changed files with 25 additions and 9 deletions
+2 -5
View File
@@ -36,7 +36,6 @@ func NewPusher(cfg *config.HubConfig, logger *log.Logger) *Pusher {
}
// Push sends a report to the hub. Retries 3 times with 5s backoff.
// Never returns error to caller — push failures should not affect controller operation.
func (p *Pusher) Push(report *Report) error {
if !p.enabled {
return nil
@@ -44,8 +43,7 @@ func (p *Pusher) Push(report *Report) error {
data, err := json.Marshal(report)
if err != nil {
p.logger.Printf("[WARN] Hub report marshal failed: %v", err)
return nil
return fmt.Errorf("marshal report: %w", err)
}
url := p.hubURL + "/api/v1/report"
@@ -81,8 +79,7 @@ func (p *Pusher) Push(report *Report) error {
lastErr = fmt.Errorf("HTTP %d", resp.StatusCode)
}
p.logger.Printf("[WARN] Hub report push failed after 3 attempts: %v", lastErr)
return nil
return fmt.Errorf("hub push failed after 3 attempts: %w", lastErr)
}
// PushOnce sends a single report regardless of the enabled flag.