mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-07 00:17:17 +08:00
add stepStatusMapByStepId in runtimeStorage and logic for update related status on ui
This commit is contained in:
+20
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user