MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / waitForRunningStepsToFinish

Function waitForRunningStepsToFinish

background.js:4546–4564  ·  view source on GitHub ↗
(payload = {})

Source from the content-addressed store, hash-verified

4544}
4545
4546async function waitForRunningStepsToFinish(payload = {}) {
4547 let currentState = await getState();
4548 let runningSteps = getRunningSteps(currentState.stepStatuses);
4549 if (!runningSteps.length) {
4550 return currentState;
4551 }
4552
4553 await addLog(`自动继续:检测到步骤 ${runningSteps.join(', ')} 正在运行,等待完成后再继续自动流程...`, 'info');
4554 await broadcastAutoRunStatus('waiting_step', payload);
4555
4556 while (runningSteps.length) {
4557 await sleepWithStop(250);
4558 currentState = await getState();
4559 runningSteps = getRunningSteps(currentState.stepStatuses);
4560 }
4561
4562 await addLog('自动继续:当前运行步骤已结束,准备按最新进度继续自动流程...', 'info');
4563 return currentState;
4564}
4565
4566async function markRunningStepsStopped() {
4567 const state = await getState();

Callers 1

autoRunLoopFunction · 0.85

Calls 5

getStateFunction · 0.85
broadcastAutoRunStatusFunction · 0.85
sleepWithStopFunction · 0.85
getRunningStepsFunction · 0.70
addLogFunction · 0.70

Tested by

no test coverage detected