Guard against pinging YP when offline. Closes #600

This commit is contained in:
Gabe Kangas 2021-03-22 20:31:25 -07:00
parent ec4b6fd4c4
commit 1509a65167

View File

@ -64,6 +64,12 @@ func (yp *YP) ping() {
return
}
// Hack: Don't allow ping'ing when offline.
// It shouldn't even be trying to, but on some instances the ping timer isn't stopping.
if !getStatus().Online {
return
}
myInstanceURL := data.GetServerURL()
if myInstanceURL == "" {
log.Warnln("Server URL not set in the configuration. Directory access is disabled until this is set.")