This commit is contained in:
root
2026-05-17 04:31:59 +00:00
parent 75a0ca4e31
commit 07aa02bca6
51 changed files with 1322 additions and 435 deletions

View File

@@ -89,6 +89,8 @@ export function LiveProcessLiveLogCard({
const outRef = useRef<HTMLPreElement>(null);
const errRef = useRef<HTMLPreElement>(null);
const prevOnlineRef = useRef(false);
const pullInFlightRef = useRef(false);
const pullQueuedRef = useRef(false);
const douyinHints = extractDouyinRoomHints(urlListText);
const onlineNow = /^(online|running)$/i.test(processStatus);
@@ -99,6 +101,11 @@ export function LiveProcessLiveLogCard({
const pull = useCallback(async () => {
if (!currentProc) return;
if (pullInFlightRef.current) {
pullQueuedRef.current = true;
return;
}
pullInFlightRef.current = true;
try {
const data = await fetchJson<StatusPayload>(
`/status?process=${encodeURIComponent(currentProc)}`,
@@ -125,6 +132,12 @@ export function LiveProcessLiveLogCard({
setBusinessNote("");
setFfmpegPids([]);
setLogAgeSeconds(null);
} finally {
pullInFlightRef.current = false;
if (pullQueuedRef.current) {
pullQueuedRef.current = false;
window.setTimeout(() => void pull(), 0);
}
}
}, [currentProc, fetchJson]);