|
|
|
@@ -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 := "" |
|
|
|
|