@@ -16,7 +16,7 @@ import (
1616 "go.uber.org/zap"
1717)
1818
19- const MAX_RETRIES = 5
19+ const MAX_RETRIES = 3
2020const SLEEP_BETWEEN_RETRIES = 5
2121
2222func NewHTTPRequest (method , url string , data []byte ) (* http.Request , context.Context , context.CancelFunc , error ) {
@@ -27,7 +27,7 @@ func NewHTTPRequest(method, url string, data []byte) (*http.Request, context.Con
2727 req .Header .Set ("X-App-Client-ID" , node .Self .ID )
2828 req .Header .Set ("X-App-Client-Key" , node .Self .PublicKey )
2929 req .Header .Set ("X-App-Request-Hash" , requestHash )
30- ctx , cncl := context .WithTimeout (context .Background (), time .Second * 60 )
30+ ctx , cncl := context .WithTimeout (context .Background (), time .Second * 90 )
3131 return req , ctx , cncl , err
3232}
3333
@@ -71,7 +71,7 @@ func SendPostRequest(url string, data []byte, wg *sync.WaitGroup) (body []byte,
7171 time .Sleep (SLEEP_BETWEEN_RETRIES * time .Second )
7272 }
7373 if resp == nil || err != nil {
74- Logger .Error ("Failed after multiple retries" , zap .Any ("url" , url ), zap .Int ("retried" , MAX_RETRIES ), zap .Error (err ))
74+ Logger .Error ("Failed after multiple retries" , zap .Any ("url" , url ), zap .Int ("retried" , MAX_RETRIES ), zap .Int ( "post_data_len" , len ( data )), zap . Error (err ))
7575 return nil , err
7676 }
7777 if resp .Body == nil {
0 commit comments