mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-09-16 19:51:38 +08:00
Add "run task" button to DeadTasksTable
This commit is contained in:
@@ -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) {
|
||||
|
@@ -7,6 +7,7 @@ import {
|
||||
DELETE_DEAD_TASK_SUCCESS,
|
||||
DELETE_RETRY_TASK_SUCCESS,
|
||||
DELETE_SCHEDULED_TASK_SUCCESS,
|
||||
RUN_DEAD_TASK_SUCCESS,
|
||||
TasksActionTypes,
|
||||
} from "../actions/tasksActions";
|
||||
|
||||
@@ -33,6 +34,13 @@ function snackbarReducer(
|
||||
isOpen: false,
|
||||
};
|
||||
|
||||
case RUN_DEAD_TASK_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
// TODO: show only task id
|
||||
message: `Dead task ${action.taskKey} is now pending`,
|
||||
};
|
||||
|
||||
case DELETE_SCHEDULED_TASK_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
|
@@ -30,6 +30,9 @@ import {
|
||||
BATCH_DELETE_DEAD_TASKS_BEGIN,
|
||||
BATCH_DELETE_DEAD_TASKS_SUCCESS,
|
||||
BATCH_DELETE_DEAD_TASKS_ERROR,
|
||||
RUN_DEAD_TASK_BEGIN,
|
||||
RUN_DEAD_TASK_SUCCESS,
|
||||
RUN_DEAD_TASK_ERROR,
|
||||
} from "../actions/tasksActions";
|
||||
import {
|
||||
ActiveTask,
|
||||
@@ -419,6 +422,7 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_DEAD_TASK_BEGIN:
|
||||
case DELETE_DEAD_TASK_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
@@ -433,6 +437,7 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_DEAD_TASK_SUCCESS:
|
||||
case DELETE_DEAD_TASK_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
@@ -444,6 +449,7 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_DEAD_TASK_ERROR:
|
||||
case DELETE_DEAD_TASK_ERROR:
|
||||
return {
|
||||
...state,
|
||||
|
Reference in New Issue
Block a user