mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
api/client.go: Don't report io.EOF as an error.
This commit is contained in:
parent
daa89cf372
commit
7feee11fad
1 changed files with 6 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -45,7 +46,11 @@ func (c *Client) worker(channel Channel, h handler) {
|
||||||
for {
|
for {
|
||||||
payload, err := c.reader.Read(channel)
|
payload, err := c.reader.Read(channel)
|
||||||
if err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue