From 25efdea49d45c47826a3416d51d8599c4dc8e60c Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 23 Nov 2022 08:46:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E8=AF=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/modelarts/modelarts.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/modelarts/modelarts.go b/modules/modelarts/modelarts.go index 3629f4231..8c3dd69d6 100755 --- a/modules/modelarts/modelarts.go +++ b/modules/modelarts/modelarts.go @@ -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 := ""