Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Display YP errors

Gabe Kangas12e67cf5f758
diff --git a/yp/yp.go b/yp/yp.go
index 7cf1a415c0..d0c5bc983c 100644
--- a/yp/yp.go
+++ b/yp/yp.go
@@ -18,6 +18,7 @@ import (
const pingInterval = 4 * time.Minute
var getStatus func() models.Status
+var _inErrorState = false
//YP is a service for handling listing in the Owncast directory.
type YP struct {
@@ -97,10 +98,15 @@ func (yp *YP) ping() {
json.Unmarshal(body, &pingResponse)
if !pingResponse.Success {
- log.Debugln("YP Ping error returned from service:", pingResponse.Error)
+ if !_inErrorState {
+ log.Warnln("YP Ping error returned from service:", pingResponse.Error)
+ }
+ _inErrorState = true
return
}
+ _inErrorState = false
+
if pingResponse.Key != key {
yp.writeSavedKey(pingResponse.Key)
}