Browse Source

allocate yp at launch to allow for enabling it later

pull/789/head
Gabe Kangas 4 years ago
parent
commit
a67e938875
  1. 4
      core/core.go
  2. 4
      yp/yp.go

4
core/core.go

@ -63,9 +63,7 @@ func Start() error { @@ -63,9 +63,7 @@ func Start() error {
return err
}
if data.GetDirectoryEnabled() {
_yp = yp.NewYP(GetStatus)
}
_yp = yp.NewYP(GetStatus)
chat.Setup(ChatListenerImpl{})

4
yp/yp.go

@ -60,6 +60,10 @@ func (yp *YP) Stop() { @@ -60,6 +60,10 @@ func (yp *YP) Stop() {
}
func (yp *YP) ping() {
if !data.GetDirectoryEnabled() {
return
}
myInstanceURL := data.GetServerURL()
if myInstanceURL == "" {
log.Warnln("Server URL not set in the configuration. Directory access is disabled until this is set.")

Loading…
Cancel
Save