1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

api/client.go: Don't report io.EOF as an error.

This commit is contained in:
Henrik Hautakoski 2024-02-07 17:31:19 +01:00
parent daa89cf372
commit 7feee11fad

View file

@ -2,6 +2,7 @@ package api
import (
"fmt"
"io"
"sync"
"time"
@ -45,7 +46,11 @@ func (c *Client) worker(channel Channel, h handler) {
for {
payload, err := c.reader.Read(channel)
if err != nil {
c.post(err)
// Dont report EOF as an error because it is used
// by readers to signal an graceful end of input.
if err != io.EOF {
c.post(err)
}
return
}