Add "run task" button to DeadTasksTable

This commit is contained in:
Ken Hibino
2020-12-14 07:14:10 -08:00
parent d9a3e414b8
commit 903820e6c8
6 changed files with 95 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ import {
LIST_PENDING_TASKS_SUCCESS,
LIST_RETRY_TASKS_SUCCESS,
LIST_SCHEDULED_TASKS_SUCCESS,
RUN_DEAD_TASK_SUCCESS,
TasksActionTypes,
} from "../actions/tasksActions";
import { DailyStat, Queue } from "../api";
@@ -151,6 +152,23 @@ function queuesReducer(
return { ...state, data: newData };
}
case RUN_DEAD_TASK_SUCCESS: {
const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) {
return queueInfo;
}
return {
...queueInfo,
currentStats: {
...queueInfo.currentStats,
pending: queueInfo.currentStats.pending + 1,
dead: queueInfo.currentStats.dead - 1,
},
};
});
return { ...state, data: newData };
}
case DELETE_SCHEDULED_TASK_SUCCESS: {
const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) {