Skip to content

Commit a6bb744

Browse files
committed
Merge branch 'fix/alloc-size' of https://github.com/0chain/blobber into fix/alloc-size
2 parents aae1f75 + 2b2f382 commit a6bb744

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

code/go/0chain.net/blobbercore/challenge/protocol.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (cr *ChallengeEntity) LoadValidationTickets(ctx context.Context) error {
223223
allocMu.RUnlock()
224224

225225
postDataBytes, err := json.Marshal(postData)
226-
logging.Logger.Info("[challenge]post: ", zap.Any("challenge_id", cr.ChallengeID), zap.Any("post_data_len", len(postData)/(1024*1024)))
226+
logging.Logger.Info("[challenge]post: ", zap.Any("challenge_id", cr.ChallengeID), zap.Any("post_data_len", len(postDataBytes)/(1024*1024)))
227227
if err != nil {
228228
logging.Logger.Error("[db]form: " + err.Error())
229229
cr.CancelChallenge(ctx, err)

code/go/0chain.net/core/util/http.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"go.uber.org/zap"
1818
)
1919

20-
const MAX_RETRIES = 5
20+
const MAX_RETRIES = 3
2121
const SLEEP_BETWEEN_RETRIES = 5
2222

2323
func NewHTTPRequest(method, url string, data []byte) (*http.Request, context.Context, context.CancelFunc, error) {
@@ -28,7 +28,7 @@ func NewHTTPRequest(method, url string, data []byte) (*http.Request, context.Con
2828
req.Header.Set("X-App-Client-ID", node.Self.ID)
2929
req.Header.Set("X-App-Client-Key", node.Self.PublicKey)
3030
req.Header.Set("X-App-Request-Hash", requestHash)
31-
ctx, cncl := context.WithTimeout(context.Background(), time.Second*60)
31+
ctx, cncl := context.WithTimeout(context.Background(), time.Second*90)
3232
return req, ctx, cncl, err
3333
}
3434

@@ -79,7 +79,7 @@ func SendPostRequest(postURL string, data []byte, wg *sync.WaitGroup) (body []by
7979
time.Sleep(SLEEP_BETWEEN_RETRIES * time.Second)
8080
}
8181
if resp == nil || err != nil {
82-
Logger.Error("Failed after multiple retries", zap.Any("url", u.String()), zap.Int("retried", MAX_RETRIES), zap.Error(err))
82+
Logger.Error("Failed after multiple retries", zap.Any("url", u.String()), zap.Int("retried", MAX_RETRIES), zap.Int("post_data_len", len(data)), zap.Error(err))
8383
return nil, err
8484
}
8585
if resp.Body == nil {

0 commit comments

Comments
 (0)