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:
2026-07-23 10:48:16 +00:00
parent b89f239d02
commit b2297c7773
2 changed files with 3 additions and 16 deletions
+1 -14
View File
@@ -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
View File
@@ -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