mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
handle transient 404
This commit is contained in:
@@ -2,6 +2,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import tljh.systemd as systemd
|
import tljh.systemd as systemd
|
||||||
import tljh.conda as conda
|
import tljh.conda as conda
|
||||||
|
from urllib.error import HTTPError
|
||||||
from urllib.request import urlopen, URLError
|
from urllib.request import urlopen, URLError
|
||||||
from tljh import user
|
from tljh import user
|
||||||
import secrets
|
import secrets
|
||||||
@@ -151,6 +152,13 @@ def ensure_jupyterhub_running(times=4):
|
|||||||
continue
|
continue
|
||||||
# Everything else should immediately abort
|
# Everything else should immediately abort
|
||||||
raise
|
raise
|
||||||
|
except HTTPError as h:
|
||||||
|
if h.code == 404:
|
||||||
|
# May be transient
|
||||||
|
time.sleep(1)
|
||||||
|
continue
|
||||||
|
# Everything else should immediately abort
|
||||||
|
raise
|
||||||
|
|
||||||
raise Exception("Installation failed: JupyterHub did not start in {}s".format(times))
|
raise Exception("Installation failed: JupyterHub did not start in {}s".format(times))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user