@@ -17,7 +17,7 @@ import (
1717 "go.uber.org/zap"
1818)
1919
20- const MAX_RETRIES = 5
20+ const MAX_RETRIES = 3
2121const SLEEP_BETWEEN_RETRIES = 5
2222
2323func 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