diff --git a/output_tcp.go b/output_tcp.go index 2a3680c..8852728 100644 --- a/output_tcp.go +++ b/output_tcp.go @@ -88,8 +88,8 @@ func (o *TCPOutput) worker(bufferIndex int) { if err != nil { Debug(2, "INFO: TCP output connection closed, reconnecting") - o.buf[bufferIndex] <- msg go o.worker(bufferIndex) + o.buf[bufferIndex] <- msg break } } diff --git a/output_ws.go b/output_ws.go index 3f2a102..25fd8b4 100644 --- a/output_ws.go +++ b/output_ws.go @@ -97,8 +97,8 @@ func (o *WebSocketOutput) worker(bufferIndex int) { err = conn.WriteMessage(websocket.BinaryMessage, append(msg.Meta, msg.Data...)) if err != nil { Debug(2, "INFO: WebSocket output connection closed, reconnecting "+err.Error()) - o.buf[bufferIndex] <- msg go o.worker(bufferIndex) + o.buf[bufferIndex] <- msg break } }