fix: route_ready rejects 5xx responses; remove spinner from wait page
route_ready returned True on 502 Bad Gateway, causing premature redirect before the container was actually serving. Now only accepts < 500 responses. Spinner removed from wait page per user request.
This commit is contained in:
+1
-14
@@ -1582,21 +1582,9 @@ def session_wait_page(session_id: str, request: Request, user: User = Depends(re
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<title>{service_title}</title>
|
||||
<style>
|
||||
html,body{{margin:0;height:100%;background:#0f1720;font-family:sans-serif}}
|
||||
.wrap{{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px}}
|
||||
.spinner{{width:48px;height:48px;border:4px solid rgba(220,232,245,.12);border-top-color:#2a8cd6;border-radius:50%;animation:spin .85s linear infinite}}
|
||||
@keyframes spin{{to{{transform:rotate(360deg)}}}}
|
||||
.title{{color:#dce8f5;font-size:1.05rem;font-weight:600;letter-spacing:.01em}}
|
||||
.sub{{color:#6a8dab;font-size:.85rem}}
|
||||
</style>
|
||||
<style>html,body{{margin:0;height:100%;background:#0f1720}}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<div class="spinner"></div>
|
||||
<div class="title">Подготовка приложения…</div>
|
||||
<div class="sub" id="sub">{service_title}</div>
|
||||
</div>
|
||||
<script>
|
||||
const sessionId = "{session_id}";
|
||||
async function tick() {{
|
||||
@@ -1604,7 +1592,6 @@ def session_wait_page(session_id: str, request: Request, user: User = Depends(re
|
||||
const r = await fetch(`/api/sessions/${{sessionId}}/status`, {{credentials:'include'}});
|
||||
if (!r.ok) return;
|
||||
const data = await r.json();
|
||||
if (data.message) document.getElementById('sub').textContent = data.message;
|
||||
if (data.ready) {{ window.location.replace(data.redirect_url || "{redirect_target}"); return; }}
|
||||
}} catch(e) {{}}
|
||||
setTimeout(tick, 300);
|
||||
|
||||
+2
-2
@@ -532,7 +532,7 @@ def wait_for_session_route(session_id: str, timeout_seconds: int = 6) -> bool:
|
||||
allow_redirects=False,
|
||||
timeout=1.5,
|
||||
)
|
||||
if resp.status_code != 404:
|
||||
if resp.status_code < 500:
|
||||
return True
|
||||
except Exception:
|
||||
pass
|
||||
@@ -554,7 +554,7 @@ def route_ready(path: str) -> bool:
|
||||
timeout=1.5,
|
||||
verify=verify,
|
||||
)
|
||||
if resp.status_code != 404:
|
||||
if resp.status_code < 500:
|
||||
return True
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user