diff options
Diffstat (limited to 'app/client/system/system.reducer.js')
| -rw-r--r-- | app/client/system/system.reducer.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/app/client/system/system.reducer.js b/app/client/system/system.reducer.js index 27c248a..c20bf93 100644 --- a/app/client/system/system.reducer.js +++ b/app/client/system/system.reducer.js @@ -44,6 +44,7 @@ const systemInitialState = { } const systemReducer = (state = systemInitialState, action) => { + let processor = null switch(action.type) { case types.socket.connect: case types.socket.reconnecting: @@ -174,8 +175,13 @@ const systemReducer = (state = systemInitialState, action) => { stderr: "", } case types.task.task_finish: - if (state.runner[action.task.processor].task.uuid !== action.task.uuid) { - return state + if (state.runner.cpu.task.uuid === action.task.uuid) { + processor = 'cpu' + } + else if (state.runner.gpu.task.uuid === action.task.uuid) { + processor = 'gpu' + } else { + processor = null } return { ...state, @@ -184,10 +190,10 @@ const systemReducer = (state = systemInitialState, action) => { status: "disconnected", error: null, }, - runner: { + runner: processor ? { ...state.runner, - [action.task.processor]: { status: 'IDLE', task: {} }, - }, + [processor]: { status: 'IDLE', task: {} }, + } : state.runner, } case types.app.change_tool: return { |
