Skip to content

Commit

Permalink
chore(eigenda): Bump eigenda-proxy to latest v1.6.0 - fix failover bug
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed Dec 3, 2024
1 parent 17436e9 commit ddeea5f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eigenda/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func (c *client) GetData(ctx context.Context, comm []byte) ([]byte, error) {
return nil, err
}

if resp.StatusCode == http.StatusServiceUnavailable {
return nil, ErrServiceUnavailable
}

if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("received error response, code=%d, msg = %s", resp.StatusCode, string(b))
}
Expand Down Expand Up @@ -155,6 +159,10 @@ func (c *client) SetData(ctx context.Context, b []byte) ([]byte, error) {
return nil, err
}

if resp.StatusCode == http.StatusServiceUnavailable {
return nil, ErrServiceUnavailable
}

if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to store data: %v, err = %s", resp.StatusCode, string(b))
}
Expand Down

0 comments on commit ddeea5f

Please sign in to comment.