From 1509a651670e668bf043ada8523431b97d6eacb8 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 22 Mar 2021 20:31:25 -0700 Subject: [PATCH] Guard against pinging YP when offline. Closes #600 --- yp/yp.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yp/yp.go b/yp/yp.go index acfadbf39..8e639c9c0 100644 --- a/yp/yp.go +++ b/yp/yp.go @@ -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.")