Skip to content

Commit

Permalink
fix: add retry for report hashrate
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin committed Jul 30, 2024
1 parent 31c21a7 commit eb3c4ad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/http/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"net/http"
"net/url"
"strings"
"time"

"github.com/hashicorp/go-retryablehttp"
"github.com/lilypad-tech/lilypad/pkg/web3"
Expand Down Expand Up @@ -324,8 +323,8 @@ func GetRequestBuffer(

func GenericJSONPostClient(url string, json string) (*http.Response, error) {
data := []byte(json)
client := &http.Client{Timeout: time.Second * 1}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(data))
client := newRetryClient()
req, err := retryablehttp.NewRequest("POST", url, bytes.NewBuffer(data))
if err != nil {
fmt.Printf("error setting up the request: %s", err)
return nil, err
Expand Down

0 comments on commit eb3c4ad

Please sign in to comment.