v0.15.5: Fix startup hub report — Push() returns real errors, startup retries 3x with 15s delay
This commit is contained in:
@@ -290,10 +290,20 @@ func main() {
|
||||
if hubPusher != nil {
|
||||
if cfg.Hub.Enabled {
|
||||
r := report.BuildReport(cfg, stackMgr, backupMgr, cpuCollector, metricsStore, Version, sett.GetStoragePaths())
|
||||
if err := hubPusher.Push(r); err != nil {
|
||||
logger.Printf("[WARN] Startup hub report failed: %v", err)
|
||||
} else {
|
||||
logger.Println("[INFO] Startup hub report sent")
|
||||
var pushErr error
|
||||
for attempt := 1; attempt <= 3; attempt++ {
|
||||
pushErr = hubPusher.Push(r)
|
||||
if pushErr == nil {
|
||||
logger.Println("[INFO] Startup hub report sent")
|
||||
break
|
||||
}
|
||||
logger.Printf("[WARN] Startup hub report attempt %d/3 failed: %v", attempt, pushErr)
|
||||
if attempt < 3 {
|
||||
time.Sleep(15 * time.Second)
|
||||
}
|
||||
}
|
||||
if pushErr != nil {
|
||||
logger.Printf("[WARN] Startup hub report failed after 3 attempts — next scheduled push in %s", cfg.Hub.PushInterval)
|
||||
}
|
||||
} else {
|
||||
// Send a minimal "disabled" notification so hub knows reporting is intentionally off
|
||||
|
||||
Reference in New Issue
Block a user