diff --git a/main.go b/main.go index 982b0dd..83c91e7 100644 --- a/main.go +++ b/main.go @@ -141,6 +141,12 @@ func (m UploadManager) pingWorker() error { return err } + if stats == nil { + log.Warningf("ping to %s failed: %v", conf.Host, "no response") + time.Sleep(time.Duration(conf.Interval) * time.Minute) + continue + } + log.Infof("ping %s over threshold detected, starting extended pings...", stats.AvgRtt) for stats.AvgRtt.Milliseconds() >= conf.ThrottlePingThreshold { stats, err = doPing(conf.Host, conf.ConformationPPP, time.Second)