优化架构K8s 副本和队列
This commit is contained in:
@@ -2668,8 +2668,17 @@ export function PipelinePage(props: {
|
||||
const activeVideoCount = segments.filter((s) => ["running", "queued"].includes(s.status)).length;
|
||||
useEffect(() => {
|
||||
if (activeVideoCount === 0) return;
|
||||
const timer = window.setInterval(() => { void onPollVideosQuiet(); }, 5000);
|
||||
return () => window.clearInterval(timer);
|
||||
const tick = () => {
|
||||
if (document.hidden) return;
|
||||
void onPollVideosQuiet();
|
||||
};
|
||||
const timer = window.setInterval(tick, 5000);
|
||||
const onVis = () => { if (!document.hidden) void onPollVideosQuiet(); };
|
||||
document.addEventListener("visibilitychange", onVis);
|
||||
return () => {
|
||||
window.clearInterval(timer);
|
||||
document.removeEventListener("visibilitychange", onVis);
|
||||
};
|
||||
}, [activeVideoCount, onPollVideosQuiet]);
|
||||
|
||||
// 进入视频 / 拼接阶段时回填已有成片(此前合成过就直接给出播放/下载入口)
|
||||
|
||||
Reference in New Issue
Block a user