fix(eventhub): mark as offline if keepalive fails to send

pull/3275/head
Aaron Liu 3 months ago
parent 1f580f0d8a
commit b913b4683f

@ -97,6 +97,12 @@ func (s *ExplorerEventService) HandleExplorerEventsPush(c *gin.Context) error {
c.SSEvent("event", evt)
l.Debug("Event sent: %+v", evt)
c.Writer.Flush()
if c.Errors.Last() != nil {
l.Error("Error occurred: %+v", c.Errors.Last().Error())
eventHub.Unsubscribe(c, parent.ID(), requestInfo.ClientID)
l.Debug("Unsubscribed from event hub")
return nil
}
case <-keepAliveTicker.C:
c.SSEvent("keep-alive", nil)
c.Writer.Flush()

Loading…
Cancel
Save