Browse Source

重试优化

tags/v1.22.11.3^2
ychao_1983 3 years ago
parent
commit
25efdea49d
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      modules/modelarts/modelarts.go

+ 6
- 2
modules/modelarts/modelarts.go View File

@@ -974,11 +974,15 @@ func getJupyterBaseUrl(url string) string {
func getCookiesAndCsrf(jupyterUrl string) ([]*http.Cookie, string) {
log.Info("jupyter url:"+jupyterUrl)
var cookies []*http.Cookie
for i := 0; i < 10; i++ {
const retryTimes = 10
for i := 0; i < retryTimes; i++ {
res, err := http.Get(jupyterUrl)
if err != nil {
log.Error("browser jupyterUrl failed.",err)
return cookies, ""
if i==retryTimes-1{
return cookies, ""
}

} else {
cookies = res.Cookies()
xsrf := ""


Loading…
Cancel
Save