优化架构K8s 副本和队列
This commit is contained in:
@@ -453,7 +453,13 @@ export function App() {
|
||||
}
|
||||
const active = detail.video_segments.filter((segment) => ["running", "queued"].includes(segment.status));
|
||||
if (active.length === 0) return;
|
||||
await Promise.all(active.map((segment) => api.pollVideo(activeProjectId, segment.id).catch(() => undefined)));
|
||||
const polls = await Promise.all(active.map((segment) => api.pollVideo(activeProjectId, segment.id).catch(() => undefined)));
|
||||
// 仍在 queued/running 就别拉整棵项目树(26KB);只有某段终态才回读详情。
|
||||
const settled = polls.some((row) => {
|
||||
const status = row && typeof row === "object" ? (row as { status?: string }).status : "";
|
||||
return Boolean(status) && status !== "running" && status !== "queued";
|
||||
}) || polls.some((row) => row && typeof row === "object" && "id" in (row as object));
|
||||
if (!settled) return;
|
||||
const next = await api.project(activeProjectId).catch(() => null);
|
||||
// 晚到的旧项目轮询结果不要冲掉已切换的当前项目详情
|
||||
if (next && next.id === activeProjectIdRef.current) {
|
||||
|
||||
Reference in New Issue
Block a user