mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 12:40:25 +08:00
feat: api请求添加自动重试
This commit is contained in:
@@ -212,7 +212,7 @@ func (r certAccountRepo) getGoogleEAB() (*acme.EAB, error) {
|
||||
}
|
||||
client := resty.New()
|
||||
client.SetTimeout(5 * time.Second)
|
||||
client.SetRetryCount(2)
|
||||
client.SetRetryCount(3)
|
||||
|
||||
resp, err := client.R().SetResult(&data{}).Get("https://gts.rat.dev/eab")
|
||||
if err != nil || !resp.IsSuccess() {
|
||||
@@ -235,7 +235,7 @@ func (r certAccountRepo) getZeroSSLEAB(email string) (*acme.EAB, error) {
|
||||
}
|
||||
client := resty.New()
|
||||
client.SetTimeout(5 * time.Second)
|
||||
client.SetRetryCount(2)
|
||||
client.SetRetryCount(3)
|
||||
|
||||
resp, err := client.R().SetFormData(map[string]string{
|
||||
"email": email,
|
||||
|
||||
@@ -34,6 +34,7 @@ func NewAPI(panelVersion, locale string, url ...string) *API {
|
||||
}
|
||||
|
||||
client := resty.New()
|
||||
client.SetRetryCount(3)
|
||||
client.SetTimeout(10 * time.Second)
|
||||
client.SetBaseURL(url[0])
|
||||
client.SetHeader(
|
||||
|
||||
Reference in New Issue
Block a user