@@ -16,7 +16,7 @@ import (
16
16
"go.uber.org/zap"
17
17
)
18
18
19
- const MAX_RETRIES = 5
19
+ const MAX_RETRIES = 3
20
20
const SLEEP_BETWEEN_RETRIES = 5
21
21
22
22
func 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
27
27
req .Header .Set ("X-App-Client-ID" , node .Self .ID )
28
28
req .Header .Set ("X-App-Client-Key" , node .Self .PublicKey )
29
29
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 )
31
31
return req , ctx , cncl , err
32
32
}
33
33
@@ -71,7 +71,7 @@ func SendPostRequest(url string, data []byte, wg *sync.WaitGroup) (body []byte,
71
71
time .Sleep (SLEEP_BETWEEN_RETRIES * time .Second )
72
72
}
73
73
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 ))
75
75
return nil , err
76
76
}
77
77
if resp .Body == nil {
0 commit comments