From ddeea5fe4cc3ee63a2b2e37debfae4ddebce8f1d Mon Sep 17 00:00:00 2001
From: Ethen Pociask <ethen@eigenlabs.org>
Date: Tue, 3 Dec 2024 23:13:46 +0700
Subject: [PATCH] chore(eigenda): Bump eigenda-proxy to latest v1.6.0 - fix
 failover bug

---
 eigenda/proxy.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/eigenda/proxy.go b/eigenda/proxy.go
index 687c24b92..1639ca0d0 100644
--- a/eigenda/proxy.go
+++ b/eigenda/proxy.go
@@ -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))
 	}
@@ -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))
 	}