fixed no response crash

This commit is contained in:
2022-07-25 15:57:26 +02:00
parent 974634451d
commit 58f787e235

View File

@@ -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)