don't quit ping loop when error on ping

This commit is contained in:
Laurent Le Houerou 2020-06-14 13:46:55 +04:00
parent fa9ec2cfbc
commit d78269f5b9

View File

@ -134,9 +134,7 @@ func (a *Arlo) Login(ctx context.Context, user string, pass string) error {
return
case _ = <-ticker.C:
if err := a.Ping(ctx); err != nil {
log.Errorf("Pingloop > error while pinging: %v > disconnect event stream", err)
_ = a.Disconnect()
return
log.Errorf("Pingloop > error while pinging: %v", err)
}
}
}
@ -294,8 +292,6 @@ func (a *Arlo) Disconnect() error {
return nil
}
// Ping makes a call to the subscriptions endpoint. The Arlo event stream requires this message to be sent every 30s.
func (a *Arlo) NotifyEventStream(payload EventStreamPayload, xcloudId string) error {
var response ErrorResponse
err := a.post(fmt.Sprintf(NotifyUri, payload.To), payload, &response, xcloudId)