优化日志输出,修复重试机制问题

This commit is contained in:
2025-04-15 11:47:40 +08:00
parent e9749db50c
commit d87ef4b41a
2 changed files with 8 additions and 5 deletions

View File

@@ -263,8 +263,8 @@ func (c *cloud) requestCloud(method string, url string, data string) (*http.Resp
req.Header.Set("Content-Type", "application/json")
var resp *http.Response
for range 2 {
token, err := c.token(false)
for i := 0; i < 2; i++ {
token, err := c.token(i == 1)
if err != nil {
return nil, err
}
@@ -289,7 +289,7 @@ func (c *cloud) requestCloud(method string, url string, data string) (*http.Resp
if err != nil {
return nil, err
}
fmt.Println("==============================")
fmt.Println("------------------------------")
fmt.Println(string(str))
}
@@ -546,7 +546,7 @@ func (c *gateway) requestGateway(method string, url string, data string) (*http.
if err != nil {
return nil, err
}
fmt.Println("==============================")
fmt.Println("------------------------------")
fmt.Println(string(str))
}