Skip to content

Commit 133d2c9

Browse files
authored
fix dead loop while network error (#77)
1 parent 67a43e6 commit 133d2c9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

stream.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"encoding/json"
88
"errors"
99
"fmt"
10-
"io"
1110
"net/http"
1211
)
1312

@@ -27,9 +26,7 @@ func (stream *CompletionStream) Recv() (response CompletionResponse, err error)
2726
waitForData:
2827
line, err := stream.reader.ReadBytes('\n')
2928
if err != nil {
30-
if errors.Is(err, io.EOF) {
31-
return
32-
}
29+
return
3330
}
3431

3532
var headerData = []byte("data: ")

0 commit comments

Comments
 (0)