Skip to content

Commit 1cb81e7

Browse files
committed
quick fix
1 parent 1619d27 commit 1cb81e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/ankacloud/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func (c *APIClient) Post(ctx context.Context, endpoint string, payload interface
7979
bodyBytes, err := io.ReadAll(r.Body)
8080
if err != nil {
8181
if strings.Contains(err.Error(), "unexpected EOF") {
82+
time.Sleep(5 * time.Second)
8283
// Retry once on unexpected EOF
8384
r2, err2 := c.HttpClient.Do(req)
8485
if err2 != nil {
@@ -143,6 +144,7 @@ func (c *APIClient) Delete(ctx context.Context, endpoint string, payload interfa
143144
bodyBytes, err := io.ReadAll(r.Body)
144145
if err != nil {
145146
if strings.Contains(err.Error(), "unexpected EOF") {
147+
time.Sleep(5 * time.Second)
146148
// Retry once on unexpected EOF
147149
r2, err2 := c.HttpClient.Do(req)
148150
if err2 != nil {
@@ -204,6 +206,7 @@ func (c *APIClient) Get(ctx context.Context, endpoint string, queryParams map[st
204206
bodyBytes, err := io.ReadAll(r.Body)
205207
if err != nil {
206208
if strings.Contains(err.Error(), "unexpected EOF") {
209+
time.Sleep(5 * time.Second)
207210
// Retry once on unexpected EOF
208211
r2, err2 := c.HttpClient.Do(req)
209212
if err2 != nil {

0 commit comments

Comments
 (0)