add stepStatusMapByStepId in runtimeStorage and logic for update related status on ui

This commit is contained in:
geekgeekrun
2026-04-05 13:47:56 +08:00
parent e09e7ee936
commit 15e566b343
5 changed files with 80 additions and 11 deletions
+20 -1
View File
@@ -143,6 +143,23 @@ function handleMessage(socket, message) {
return
}
case 'worker-to-gui-message': {
// 将 prerequisite step 状态写入 worker 的 runtimeStorage
if (
workerInfo &&
message.data?.type === 'prerequisite-step-by-step-check' &&
message.data?.step?.id
) {
workerInfo.runtimeStorage = workerInfo.runtimeStorage || {}
workerInfo.runtimeStorage.stepStatusMapByStepId =
workerInfo.runtimeStorage.stepStatusMapByStepId || {}
workerInfo.runtimeStorage.stepStatusMapByStepId[
message.data.step.id
] = {
step: message.data.step,
runRecordId: message.data.runRecordId
}
}
// 转发工具进程消息到GUI客户端
broadcastToGUI({
type: 'worker-to-gui-message',
@@ -329,7 +346,9 @@ function startWorker({ workerId, command, args, env }, restartCount = 0) {
status: 'running',
startTime: Date.now(),
restartCount, // 使用传入的重启次数
runtimeStorage: {},
runtimeStorage: {
stepStatusMapByStepId: {}
},
// socket: null, // 工具进程的TCP连接,稍后由工具进程注册
// lastHeartbeat: null,
command,