Add batch delete button to DeadTasksTable

This commit is contained in:
Ken Hibino
2020-12-13 07:51:40 -08:00
parent 62780e201e
commit ef60304015
7 changed files with 175 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ import {
DELETE_QUEUE_SUCCESS,
} from "../actions/queuesActions";
import {
BATCH_DELETE_DEAD_TASKS_SUCCESS,
DELETE_DEAD_TASK_SUCCESS,
DELETE_RETRY_TASK_SUCCESS,
DELETE_SCHEDULED_TASK_SUCCESS,
@@ -198,6 +199,23 @@ function queuesReducer(
return { ...state, data: newData };
}
case BATCH_DELETE_DEAD_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) {
return queueInfo;
}
return {
...queueInfo,
currentStats: {
...queueInfo.currentStats,
dead:
queueInfo.currentStats.dead - action.payload.deleted_keys.length,
},
};
});
return { ...state, data: newData };
}
default:
return state;
}