X-Git-Url: https://git.realraum.at/?p=svn42.git;a=blobdiff_plain;f=go%2Fr3-netstatus%2Fmain.go;h=bb6ffb55b444346159124c8f693eff3c9563361f;hp=66763ff7a816362320c9190f0f8ff811ef81f1a6;hb=762ecd62c9bca5d9a4c9696dcf477d1000a28f42;hpb=114821ef8e7567df37044ecd77b4d807216b0946 diff --git a/go/r3-netstatus/main.go b/go/r3-netstatus/main.go index 66763ff..bb6ffb5 100644 --- a/go/r3-netstatus/main.go +++ b/go/r3-netstatus/main.go @@ -120,7 +120,8 @@ func EventToXMPP(bot *r3xmppbot.XmppBot, events <- chan interface{}, xmpp_presen xmpp_presence_events_chan <- present_status last_buttonpress = 0 } - + // Try to XMPP Ping the server and if that fails, quit XMPPBot + if bot.PingServer(2000) == false { return } case r3events.DoorProblemEvent: xmpp_presence_events_chan <- r3xmppbot.XMPPMsgEvent{Msg: fmt.Sprintf("Door Problem: %s. SeverityLevel: %d (%s)",event.Problem, event.Severity, time.Unix(event.Ts,0).String()), DistributeLevel: r3xmppbot.R3OnlineOnlyInfo, RememberAsStatus: false} } @@ -193,7 +194,7 @@ func main() { go RunXMPPBot(ps, zmqctx) // --- receive and distribute events --- - ticker := time.NewTicker(time.Duration(7) * time.Minute) + ticker := time.NewTicker(time.Duration(5) * time.Minute) for { select { case e := <-zmqsub.In():