Add batch run button to DeadTasksTable

This commit is contained in:
Ken Hibino
2020-12-15 06:46:23 -08:00
parent 706e80580d
commit 9bfd373f85
6 changed files with 132 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ import {
} from "../actions/queuesActions";
import {
BATCH_DELETE_DEAD_TASKS_SUCCESS,
BATCH_RUN_DEAD_TASKS_SUCCESS,
DELETE_DEAD_TASK_SUCCESS,
DELETE_RETRY_TASK_SUCCESS,
DELETE_SCHEDULED_TASK_SUCCESS,
@@ -217,6 +218,26 @@ function queuesReducer(
return { ...state, data: newData };
}
case BATCH_RUN_DEAD_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) {
return queueInfo;
}
return {
...queueInfo,
currentStats: {
...queueInfo.currentStats,
pending:
queueInfo.currentStats.pending +
action.payload.pending_keys.length,
dead:
queueInfo.currentStats.dead - action.payload.pending_keys.length,
},
};
});
return { ...state, data: newData };
}
case BATCH_DELETE_DEAD_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) {