2020-11-24 22:54:00 +08:00
|
|
|
import {
|
2020-12-13 23:51:40 +08:00
|
|
|
batchDeleteDeadTasks,
|
2020-12-19 22:07:23 +08:00
|
|
|
batchDeleteRetryTasks,
|
|
|
|
batchDeleteScheduledTasks,
|
2020-12-13 23:51:40 +08:00
|
|
|
BatchDeleteTasksResponse,
|
2020-12-19 23:38:23 +08:00
|
|
|
batchKillRetryTasks,
|
|
|
|
batchKillScheduledTasks,
|
|
|
|
BatchKillTasksResponse,
|
2020-12-15 22:46:23 +08:00
|
|
|
batchRunDeadTasks,
|
2020-12-19 22:07:23 +08:00
|
|
|
batchRunRetryTasks,
|
|
|
|
batchRunScheduledTasks,
|
2020-12-15 22:46:23 +08:00
|
|
|
BatchRunTasksResponse,
|
2020-12-06 01:24:42 +08:00
|
|
|
cancelActiveTask,
|
2020-12-16 22:55:51 +08:00
|
|
|
deleteAllDeadTasks,
|
2020-12-19 22:07:23 +08:00
|
|
|
deleteAllRetryTasks,
|
|
|
|
deleteAllScheduledTasks,
|
2020-12-09 22:56:44 +08:00
|
|
|
deleteDeadTask,
|
2020-12-09 13:22:23 +08:00
|
|
|
deleteRetryTask,
|
2020-12-09 22:56:44 +08:00
|
|
|
deleteScheduledTask,
|
2020-12-19 23:38:23 +08:00
|
|
|
killAllRetryTasks,
|
|
|
|
killAllScheduledTasks,
|
|
|
|
killRetryTask,
|
|
|
|
killScheduledTask,
|
2020-11-24 22:54:00 +08:00
|
|
|
listActiveTasks,
|
|
|
|
ListActiveTasksResponse,
|
|
|
|
listDeadTasks,
|
|
|
|
ListDeadTasksResponse,
|
|
|
|
listPendingTasks,
|
|
|
|
ListPendingTasksResponse,
|
|
|
|
listRetryTasks,
|
|
|
|
ListRetryTasksResponse,
|
|
|
|
listScheduledTasks,
|
|
|
|
ListScheduledTasksResponse,
|
|
|
|
PaginationOptions,
|
2020-12-17 22:57:30 +08:00
|
|
|
runAllDeadTasks,
|
2020-12-19 22:07:23 +08:00
|
|
|
runAllRetryTasks,
|
|
|
|
runAllScheduledTasks,
|
2020-12-14 23:14:10 +08:00
|
|
|
runDeadTask,
|
2020-12-19 22:35:08 +08:00
|
|
|
runRetryTask,
|
|
|
|
runScheduledTask,
|
2020-11-24 22:54:00 +08:00
|
|
|
} from "../api";
|
|
|
|
import { Dispatch } from "redux";
|
|
|
|
|
|
|
|
// List of tasks related action types.
|
|
|
|
export const LIST_ACTIVE_TASKS_BEGIN = "LIST_ACTIVE_TASKS_BEGIN";
|
|
|
|
export const LIST_ACTIVE_TASKS_SUCCESS = "LIST_ACTIVE_TASKS_SUCCESS";
|
|
|
|
export const LIST_ACTIVE_TASKS_ERROR = "LIST_ACTIVE_TASKS_ERROR";
|
|
|
|
export const LIST_PENDING_TASKS_BEGIN = "LIST_PENDING_TASKS_BEGIN";
|
|
|
|
export const LIST_PENDING_TASKS_SUCCESS = "LIST_PENDING_TASKS_SUCCESS";
|
|
|
|
export const LIST_PENDING_TASKS_ERROR = "LIST_PENDING_TASKS_ERROR";
|
|
|
|
export const LIST_SCHEDULED_TASKS_BEGIN = "LIST_SCHEDULED_TASKS_BEGIN";
|
|
|
|
export const LIST_SCHEDULED_TASKS_SUCCESS = "LIST_SCHEDULED_TASKS_SUCCESS";
|
|
|
|
export const LIST_SCHEDULED_TASKS_ERROR = "LIST_SCHEDULED_TASKS_ERROR";
|
|
|
|
export const LIST_RETRY_TASKS_BEGIN = "LIST_RETRY_TASKS_BEGIN";
|
|
|
|
export const LIST_RETRY_TASKS_SUCCESS = "LIST_RETRY_TASKS_SUCCESS";
|
|
|
|
export const LIST_RETRY_TASKS_ERROR = "LIST_RETRY_TASKS_ERROR";
|
|
|
|
export const LIST_DEAD_TASKS_BEGIN = "LIST_DEAD_TASKS_BEGIN";
|
|
|
|
export const LIST_DEAD_TASKS_SUCCESS = "LIST_DEAD_TASKS_SUCCESS";
|
|
|
|
export const LIST_DEAD_TASKS_ERROR = "LIST_DEAD_TASKS_ERROR";
|
2020-12-06 01:24:42 +08:00
|
|
|
export const CANCEL_ACTIVE_TASK_BEGIN = "CANCEL_ACTIVE_TASK_BEGIN";
|
|
|
|
export const CANCEL_ACTIVE_TASK_SUCCESS = "CANCEL_ACTIVE_TASK_SUCCESS";
|
|
|
|
export const CANCEL_ACTIVE_TASK_ERROR = "CANCEL_ACTIVE_TASK_ERROR";
|
2020-12-19 22:35:08 +08:00
|
|
|
export const RUN_SCHEDULED_TASK_BEGIN = "RUN_DEAD_TASK_BEGIN";
|
|
|
|
export const RUN_SCHEDULED_TASK_SUCCESS = "RUN_DEAD_TASK_SUCCESS";
|
|
|
|
export const RUN_SCHEDULED_TASK_ERROR = "RUN_DEAD_TASK_ERROR";
|
|
|
|
export const RUN_RETRY_TASK_BEGIN = "RUN_RETRY_TASK_BEGIN";
|
|
|
|
export const RUN_RETRY_TASK_SUCCESS = "RUN_RETRY_TASK_SUCCESS";
|
|
|
|
export const RUN_RETRY_TASK_ERROR = "RUN_RETRY_TASK_ERROR";
|
2020-12-14 23:14:10 +08:00
|
|
|
export const RUN_DEAD_TASK_BEGIN = "RUN_DEAD_TASK_BEGIN";
|
|
|
|
export const RUN_DEAD_TASK_SUCCESS = "RUN_DEAD_TASK_SUCCESS";
|
|
|
|
export const RUN_DEAD_TASK_ERROR = "RUN_DEAD_TASK_ERROR";
|
2020-12-09 22:56:44 +08:00
|
|
|
export const DELETE_SCHEDULED_TASK_BEGIN = "DELETE_SCHEDULED_TASK_BEGIN";
|
|
|
|
export const DELETE_SCHEDULED_TASK_SUCCESS = "DELETE_SCHEDULED_TASK_SUCCESS";
|
|
|
|
export const DELETE_SCHEDULED_TASK_ERROR = "DELETE_SCHEDULED_TASK_ERROR";
|
2020-12-19 23:38:23 +08:00
|
|
|
export const KILL_SCHEDULED_TASK_BEGIN = "KILL_DEAD_TASK_BEGIN";
|
|
|
|
export const KILL_SCHEDULED_TASK_SUCCESS = "KILL_DEAD_TASK_SUCCESS";
|
|
|
|
export const KILL_SCHEDULED_TASK_ERROR = "KILL_DEAD_TASK_ERROR";
|
|
|
|
export const KILL_RETRY_TASK_BEGIN = "KILL_RETRY_TASK_BEGIN";
|
|
|
|
export const KILL_RETRY_TASK_SUCCESS = "KILL_RETRY_TASK_SUCCESS";
|
|
|
|
export const KILL_RETRY_TASK_ERROR = "KILL_RETRY_TASK_ERROR";
|
2020-12-19 22:07:23 +08:00
|
|
|
export const BATCH_RUN_SCHEDULED_TASKS_BEGIN =
|
|
|
|
"BATCH_RUN_SCHEDULED_TASKS_BEGIN";
|
|
|
|
export const BATCH_RUN_SCHEDULED_TASKS_SUCCESS =
|
|
|
|
"BATCH_RUN_SCHEDULED_TASKS_SUCCESS";
|
|
|
|
export const BATCH_RUN_SCHEDULED_TASKS_ERROR =
|
|
|
|
"BATCH_RUN_SCHEDULED_TASKS_ERROR";
|
2020-12-19 23:38:23 +08:00
|
|
|
export const BATCH_KILL_SCHEDULED_TASKS_BEGIN =
|
|
|
|
"BATCH_KILL_SCHEDULED_TASKS_BEGIN";
|
|
|
|
export const BATCH_KILL_SCHEDULED_TASKS_SUCCESS =
|
|
|
|
"BATCH_KILL_SCHEDULED_TASKS_SUCCESS";
|
|
|
|
export const BATCH_KILL_SCHEDULED_TASKS_ERROR =
|
|
|
|
"BATCH_RUN_SCHEDULED_TASKS_ERROR";
|
2020-12-19 22:07:23 +08:00
|
|
|
export const BATCH_DELETE_SCHEDULED_TASKS_BEGIN =
|
|
|
|
"BATCH_DELETE_SCHEDULED_TASKS_BEGIN";
|
|
|
|
export const BATCH_DELETE_SCHEDULED_TASKS_SUCCESS =
|
|
|
|
"BATCH_DELETE_SCHEDULED_TASKS_SUCCESS";
|
|
|
|
export const BATCH_DELETE_SCHEDULED_TASKS_ERROR =
|
|
|
|
"BATCH_DELETE_SCHEDULED_TASKS_ERROR";
|
|
|
|
export const RUN_ALL_SCHEDULED_TASKS_BEGIN = "RUN_ALL_SCHEDULED_TASKS_BEGIN";
|
|
|
|
export const RUN_ALL_SCHEDULED_TASKS_SUCCESS =
|
|
|
|
"RUN_ALL_SCHEDULED_TASKS_SUCCESS";
|
|
|
|
export const RUN_ALL_SCHEDULED_TASKS_ERROR = "RUN_ALL_SCHEDULED_TASKS_ERROR";
|
2020-12-19 23:38:23 +08:00
|
|
|
export const KILL_ALL_SCHEDULED_TASKS_BEGIN = "KILL_ALL_SCHEDULED_TASKS_BEGIN";
|
|
|
|
export const KILL_ALL_SCHEDULED_TASKS_SUCCESS =
|
|
|
|
"KILL_ALL_SCHEDULED_TASKS_SUCCESS";
|
|
|
|
export const KILL_ALL_SCHEDULED_TASKS_ERROR = "KILL_ALL_SCHEDULED_TASKS_ERROR";
|
2020-12-19 22:07:23 +08:00
|
|
|
export const DELETE_ALL_SCHEDULED_TASKS_BEGIN =
|
|
|
|
"DELETE_ALL_SCHEDULED_TASKS_BEGIN";
|
|
|
|
export const DELETE_ALL_SCHEDULED_TASKS_SUCCESS =
|
|
|
|
"DELETE_ALL_SCHEDULED_TASKS_SUCCESS";
|
|
|
|
export const DELETE_ALL_SCHEDULED_TASKS_ERROR =
|
|
|
|
"DELETE_ALL_SCHEDULED_TASKS_ERROR";
|
2020-12-09 13:22:23 +08:00
|
|
|
export const DELETE_RETRY_TASK_BEGIN = "DELETE_RETRY_TASK_BEGIN";
|
|
|
|
export const DELETE_RETRY_TASK_SUCCESS = "DELETE_RETRY_TASK_SUCCESS";
|
|
|
|
export const DELETE_RETRY_TASK_ERROR = "DELETE_RETRY_TASK_ERROR";
|
2020-12-19 22:07:23 +08:00
|
|
|
export const BATCH_RUN_RETRY_TASKS_BEGIN = "BATCH_RUN_RETRY_TASKS_BEGIN";
|
|
|
|
export const BATCH_RUN_RETRY_TASKS_SUCCESS = "BATCH_RUN_RETRY_TASKS_SUCCESS";
|
|
|
|
export const BATCH_RUN_RETRY_TASKS_ERROR = "BATCH_RUN_RETRY_TASKS_ERROR";
|
2020-12-19 23:38:23 +08:00
|
|
|
export const BATCH_KILL_RETRY_TASKS_BEGIN = "BATCH_KILL_RETRY_TASKS_BEGIN";
|
|
|
|
export const BATCH_KILL_RETRY_TASKS_SUCCESS = "BATCH_KILL_RETRY_TASKS_SUCCESS";
|
|
|
|
export const BATCH_KILL_RETRY_TASKS_ERROR = "BATCH_KILL_RETRY_TASKS_ERROR";
|
2020-12-19 22:07:23 +08:00
|
|
|
export const BATCH_DELETE_RETRY_TASKS_BEGIN = "BATCH_DELETE_RETRY_TASKS_BEGIN";
|
|
|
|
export const BATCH_DELETE_RETRY_TASKS_SUCCESS =
|
|
|
|
"BATCH_DELETE_RETRY_TASKS_SUCCESS";
|
|
|
|
export const BATCH_DELETE_RETRY_TASKS_ERROR = "BATCH_DELETE_RETRY_TASKS_ERROR";
|
|
|
|
export const RUN_ALL_RETRY_TASKS_BEGIN = "RUN_ALL_RETRY_TASKS_BEGIN";
|
|
|
|
export const RUN_ALL_RETRY_TASKS_SUCCESS = "RUN_ALL_RETRY_TASKS_SUCCESS";
|
|
|
|
export const RUN_ALL_RETRY_TASKS_ERROR = "RUN_ALL_RETRY_TASKS_ERROR";
|
2020-12-19 23:38:23 +08:00
|
|
|
export const KILL_ALL_RETRY_TASKS_BEGIN = "KILL_ALL_RETRY_TASKS_BEGIN";
|
|
|
|
export const KILL_ALL_RETRY_TASKS_SUCCESS = "KILL_ALL_RETRY_TASKS_SUCCESS";
|
|
|
|
export const KILL_ALL_RETRY_TASKS_ERROR = "KILL_ALL_RETRY_TASKS_ERROR";
|
2020-12-19 22:07:23 +08:00
|
|
|
export const DELETE_ALL_RETRY_TASKS_BEGIN = "DELETE_ALL_RETRY_TASKS_BEGIN";
|
|
|
|
export const DELETE_ALL_RETRY_TASKS_SUCCESS = "DELETE_ALL_RETRY_TASKS_SUCCESS";
|
|
|
|
export const DELETE_ALL_RETRY_TASKS_ERROR = "DELETE_ALL_RETRY_TASKS_ERROR";
|
2020-12-09 22:56:44 +08:00
|
|
|
export const DELETE_DEAD_TASK_BEGIN = "DELETE_DEAD_TASK_BEGIN";
|
|
|
|
export const DELETE_DEAD_TASK_SUCCESS = "DELETE_DEAD_TASK_SUCCESS";
|
|
|
|
export const DELETE_DEAD_TASK_ERROR = "DELETE_DEAD_TASK_ERROR";
|
2020-12-15 22:46:23 +08:00
|
|
|
export const BATCH_RUN_DEAD_TASKS_BEGIN = "BATCH_RUN_DEAD_TASKS_BEGIN";
|
|
|
|
export const BATCH_RUN_DEAD_TASKS_SUCCESS = "BATCH_RUN_DEAD_TASKS_SUCCESS";
|
|
|
|
export const BATCH_RUN_DEAD_TASKS_ERROR = "BATCH_RUN_DEAD_TASKS_ERROR";
|
2020-12-13 23:51:40 +08:00
|
|
|
export const BATCH_DELETE_DEAD_TASKS_BEGIN = "BATCH_DELETE_DEAD_TASKS_BEGIN";
|
|
|
|
export const BATCH_DELETE_DEAD_TASKS_SUCCESS =
|
|
|
|
"BATCH_DELETE_DEAD_TASKS_SUCCESS";
|
|
|
|
export const BATCH_DELETE_DEAD_TASKS_ERROR = "BATCH_DELETE_DEAD_TASKS_ERROR";
|
2020-12-17 22:57:30 +08:00
|
|
|
export const RUN_ALL_DEAD_TASKS_BEGIN = "RUN_ALL_DEAD_TASKS_BEGIN";
|
|
|
|
export const RUN_ALL_DEAD_TASKS_SUCCESS = "RUN_ALL_DEAD_TASKS_SUCCESS";
|
|
|
|
export const RUN_ALL_DEAD_TASKS_ERROR = "RUN_ALL_DEAD_TASKS_ERROR";
|
2020-12-16 22:55:51 +08:00
|
|
|
export const DELETE_ALL_DEAD_TASKS_BEGIN = "DELETE_ALL_DEAD_TASKS_BEGIN";
|
|
|
|
export const DELETE_ALL_DEAD_TASKS_SUCCESS = "DELETE_ALL_DEAD_TASKS_SUCCESS";
|
|
|
|
export const DELETE_ALL_DEAD_TASKS_ERROR = "DELETE_ALL_DEAD_TASKS_ERROR";
|
2020-11-24 22:54:00 +08:00
|
|
|
|
|
|
|
interface ListActiveTasksBeginAction {
|
|
|
|
type: typeof LIST_ACTIVE_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListActiveTasksSuccessAction {
|
|
|
|
type: typeof LIST_ACTIVE_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: ListActiveTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListActiveTasksErrorAction {
|
|
|
|
type: typeof LIST_ACTIVE_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string; // error description
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListPendingTasksBeginAction {
|
|
|
|
type: typeof LIST_PENDING_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListPendingTasksSuccessAction {
|
|
|
|
type: typeof LIST_PENDING_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: ListPendingTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListPendingTasksErrorAction {
|
|
|
|
type: typeof LIST_PENDING_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string; // error description
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListScheduledTasksBeginAction {
|
|
|
|
type: typeof LIST_SCHEDULED_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListScheduledTasksSuccessAction {
|
|
|
|
type: typeof LIST_SCHEDULED_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: ListScheduledTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListScheduledTasksErrorAction {
|
|
|
|
type: typeof LIST_SCHEDULED_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string; // error description
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListRetryTasksBeginAction {
|
|
|
|
type: typeof LIST_RETRY_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListRetryTasksSuccessAction {
|
|
|
|
type: typeof LIST_RETRY_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: ListRetryTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListRetryTasksErrorAction {
|
|
|
|
type: typeof LIST_RETRY_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string; // error description
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListDeadTasksBeginAction {
|
|
|
|
type: typeof LIST_DEAD_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListDeadTasksSuccessAction {
|
|
|
|
type: typeof LIST_DEAD_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: ListDeadTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ListDeadTasksErrorAction {
|
|
|
|
type: typeof LIST_DEAD_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string; // error description
|
|
|
|
}
|
|
|
|
|
2020-12-06 01:24:42 +08:00
|
|
|
interface CancelActiveTaskBeginAction {
|
|
|
|
type: typeof CANCEL_ACTIVE_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskId: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface CancelActiveTaskSuccessAction {
|
|
|
|
type: typeof CANCEL_ACTIVE_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskId: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface CancelActiveTaskErrorAction {
|
|
|
|
type: typeof CANCEL_ACTIVE_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskId: string;
|
|
|
|
error: string;
|
|
|
|
}
|
2020-12-19 23:38:23 +08:00
|
|
|
|
2020-12-19 22:35:08 +08:00
|
|
|
interface RunScheduledTaskBeginAction {
|
|
|
|
type: typeof RUN_SCHEDULED_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunScheduledTaskSuccessAction {
|
|
|
|
type: typeof RUN_SCHEDULED_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunScheduledTaskErrorAction {
|
|
|
|
type: typeof RUN_SCHEDULED_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
interface KillScheduledTaskBeginAction {
|
|
|
|
type: typeof KILL_SCHEDULED_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillScheduledTaskSuccessAction {
|
|
|
|
type: typeof KILL_SCHEDULED_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillScheduledTaskErrorAction {
|
|
|
|
type: typeof KILL_SCHEDULED_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-19 22:35:08 +08:00
|
|
|
interface RunRetryTaskBeginAction {
|
|
|
|
type: typeof RUN_RETRY_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunRetryTaskSuccessAction {
|
|
|
|
type: typeof RUN_RETRY_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunRetryTaskErrorAction {
|
|
|
|
type: typeof RUN_RETRY_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
error: string;
|
|
|
|
}
|
2020-12-06 01:24:42 +08:00
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
interface KillRetryTaskBeginAction {
|
|
|
|
type: typeof KILL_RETRY_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillRetryTaskSuccessAction {
|
|
|
|
type: typeof KILL_RETRY_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillRetryTaskErrorAction {
|
|
|
|
type: typeof KILL_RETRY_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-14 23:14:10 +08:00
|
|
|
interface RunDeadTaskBeginAction {
|
|
|
|
type: typeof RUN_DEAD_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunDeadTaskSuccessAction {
|
|
|
|
type: typeof RUN_DEAD_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunDeadTaskErrorAction {
|
|
|
|
type: typeof RUN_DEAD_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-09 22:56:44 +08:00
|
|
|
interface DeleteScheduledTaskBeginAction {
|
|
|
|
type: typeof DELETE_SCHEDULED_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteScheduledTaskSuccessAction {
|
|
|
|
type: typeof DELETE_SCHEDULED_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteScheduledTaskErrorAction {
|
|
|
|
type: typeof DELETE_SCHEDULED_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-19 22:07:23 +08:00
|
|
|
interface BatchDeleteScheduledTasksBeginAction {
|
|
|
|
type: typeof BATCH_DELETE_SCHEDULED_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchDeleteScheduledTasksSuccessAction {
|
|
|
|
type: typeof BATCH_DELETE_SCHEDULED_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: BatchDeleteTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchDeleteScheduledTasksErrorAction {
|
|
|
|
type: typeof BATCH_DELETE_SCHEDULED_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchRunScheduledTasksBeginAction {
|
|
|
|
type: typeof BATCH_RUN_SCHEDULED_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchRunScheduledTasksSuccessAction {
|
|
|
|
type: typeof BATCH_RUN_SCHEDULED_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: BatchRunTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchRunScheduledTasksErrorAction {
|
|
|
|
type: typeof BATCH_RUN_SCHEDULED_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunAllScheduledTasksBeginAction {
|
|
|
|
type: typeof RUN_ALL_SCHEDULED_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunAllScheduledTasksSuccessAction {
|
|
|
|
type: typeof RUN_ALL_SCHEDULED_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunAllScheduledTasksErrorAction {
|
|
|
|
type: typeof RUN_ALL_SCHEDULED_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
interface BatchKillScheduledTasksBeginAction {
|
|
|
|
type: typeof BATCH_KILL_SCHEDULED_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchKillScheduledTasksSuccessAction {
|
|
|
|
type: typeof BATCH_KILL_SCHEDULED_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: BatchKillTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchKillScheduledTasksErrorAction {
|
|
|
|
type: typeof BATCH_KILL_SCHEDULED_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillAllScheduledTasksBeginAction {
|
|
|
|
type: typeof KILL_ALL_SCHEDULED_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillAllScheduledTasksSuccessAction {
|
|
|
|
type: typeof KILL_ALL_SCHEDULED_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillAllScheduledTasksErrorAction {
|
|
|
|
type: typeof KILL_ALL_SCHEDULED_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-19 22:07:23 +08:00
|
|
|
interface DeleteAllScheduledTasksBeginAction {
|
|
|
|
type: typeof DELETE_ALL_SCHEDULED_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteAllScheduledTasksSuccessAction {
|
|
|
|
type: typeof DELETE_ALL_SCHEDULED_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteAllScheduledTasksErrorAction {
|
|
|
|
type: typeof DELETE_ALL_SCHEDULED_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-09 13:22:23 +08:00
|
|
|
interface DeleteRetryTaskBeginAction {
|
|
|
|
type: typeof DELETE_RETRY_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteRetryTaskSuccessAction {
|
|
|
|
type: typeof DELETE_RETRY_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteRetryTaskErrorAction {
|
|
|
|
type: typeof DELETE_RETRY_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
error: string;
|
|
|
|
}
|
2020-12-09 22:56:44 +08:00
|
|
|
|
2020-12-19 22:07:23 +08:00
|
|
|
interface BatchDeleteRetryTasksBeginAction {
|
|
|
|
type: typeof BATCH_DELETE_RETRY_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchDeleteRetryTasksSuccessAction {
|
|
|
|
type: typeof BATCH_DELETE_RETRY_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: BatchDeleteTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchDeleteRetryTasksErrorAction {
|
|
|
|
type: typeof BATCH_DELETE_RETRY_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchRunRetryTasksBeginAction {
|
|
|
|
type: typeof BATCH_RUN_RETRY_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchRunRetryTasksSuccessAction {
|
|
|
|
type: typeof BATCH_RUN_RETRY_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: BatchRunTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchRunRetryTasksErrorAction {
|
|
|
|
type: typeof BATCH_RUN_RETRY_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunAllRetryTasksBeginAction {
|
|
|
|
type: typeof RUN_ALL_RETRY_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunAllRetryTasksSuccessAction {
|
|
|
|
type: typeof RUN_ALL_RETRY_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunAllRetryTasksErrorAction {
|
|
|
|
type: typeof RUN_ALL_RETRY_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
interface BatchKillRetryTasksBeginAction {
|
|
|
|
type: typeof BATCH_KILL_RETRY_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchKillRetryTasksSuccessAction {
|
|
|
|
type: typeof BATCH_KILL_RETRY_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: BatchKillTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchKillRetryTasksErrorAction {
|
|
|
|
type: typeof BATCH_KILL_RETRY_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillAllRetryTasksBeginAction {
|
|
|
|
type: typeof KILL_ALL_RETRY_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillAllRetryTasksSuccessAction {
|
|
|
|
type: typeof KILL_ALL_RETRY_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface KillAllRetryTasksErrorAction {
|
|
|
|
type: typeof KILL_ALL_RETRY_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-19 22:07:23 +08:00
|
|
|
interface DeleteAllRetryTasksBeginAction {
|
|
|
|
type: typeof DELETE_ALL_RETRY_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteAllRetryTasksSuccessAction {
|
|
|
|
type: typeof DELETE_ALL_RETRY_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteAllRetryTasksErrorAction {
|
|
|
|
type: typeof DELETE_ALL_RETRY_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-09 22:56:44 +08:00
|
|
|
interface DeleteDeadTaskBeginAction {
|
|
|
|
type: typeof DELETE_DEAD_TASK_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteDeadTaskSuccessAction {
|
|
|
|
type: typeof DELETE_DEAD_TASK_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteDeadTaskErrorAction {
|
|
|
|
type: typeof DELETE_DEAD_TASK_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKey: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-13 23:51:40 +08:00
|
|
|
interface BatchDeleteDeadTasksBeginAction {
|
|
|
|
type: typeof BATCH_DELETE_DEAD_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchDeleteDeadTasksSuccessAction {
|
|
|
|
type: typeof BATCH_DELETE_DEAD_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: BatchDeleteTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchDeleteDeadTasksErrorAction {
|
|
|
|
type: typeof BATCH_DELETE_DEAD_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-15 22:46:23 +08:00
|
|
|
interface BatchRunDeadTasksBeginAction {
|
|
|
|
type: typeof BATCH_RUN_DEAD_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchRunDeadTasksSuccessAction {
|
|
|
|
type: typeof BATCH_RUN_DEAD_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
payload: BatchRunTasksResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BatchRunDeadTasksErrorAction {
|
|
|
|
type: typeof BATCH_RUN_DEAD_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
taskKeys: string[];
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-17 22:57:30 +08:00
|
|
|
interface RunAllDeadTasksBeginAction {
|
|
|
|
type: typeof RUN_ALL_DEAD_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunAllDeadTasksSuccessAction {
|
|
|
|
type: typeof RUN_ALL_DEAD_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface RunAllDeadTasksErrorAction {
|
|
|
|
type: typeof RUN_ALL_DEAD_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-12-16 22:55:51 +08:00
|
|
|
interface DeleteAllDeadTasksBeginAction {
|
|
|
|
type: typeof DELETE_ALL_DEAD_TASKS_BEGIN;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteAllDeadTasksSuccessAction {
|
|
|
|
type: typeof DELETE_ALL_DEAD_TASKS_SUCCESS;
|
|
|
|
queue: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DeleteAllDeadTasksErrorAction {
|
|
|
|
type: typeof DELETE_ALL_DEAD_TASKS_ERROR;
|
|
|
|
queue: string;
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2020-11-24 22:54:00 +08:00
|
|
|
// Union of all tasks related action types.
|
|
|
|
export type TasksActionTypes =
|
|
|
|
| ListActiveTasksBeginAction
|
|
|
|
| ListActiveTasksSuccessAction
|
|
|
|
| ListActiveTasksErrorAction
|
|
|
|
| ListPendingTasksBeginAction
|
|
|
|
| ListPendingTasksSuccessAction
|
|
|
|
| ListPendingTasksErrorAction
|
|
|
|
| ListScheduledTasksBeginAction
|
|
|
|
| ListScheduledTasksSuccessAction
|
|
|
|
| ListScheduledTasksErrorAction
|
|
|
|
| ListRetryTasksBeginAction
|
|
|
|
| ListRetryTasksSuccessAction
|
|
|
|
| ListRetryTasksErrorAction
|
|
|
|
| ListDeadTasksBeginAction
|
|
|
|
| ListDeadTasksSuccessAction
|
2020-12-06 01:24:42 +08:00
|
|
|
| ListDeadTasksErrorAction
|
|
|
|
| CancelActiveTaskBeginAction
|
|
|
|
| CancelActiveTaskSuccessAction
|
2020-12-09 13:22:23 +08:00
|
|
|
| CancelActiveTaskErrorAction
|
2020-12-19 22:35:08 +08:00
|
|
|
| RunScheduledTaskBeginAction
|
|
|
|
| RunScheduledTaskSuccessAction
|
|
|
|
| RunScheduledTaskErrorAction
|
|
|
|
| RunRetryTaskBeginAction
|
|
|
|
| RunRetryTaskSuccessAction
|
|
|
|
| RunRetryTaskErrorAction
|
2020-12-14 23:14:10 +08:00
|
|
|
| RunDeadTaskBeginAction
|
|
|
|
| RunDeadTaskSuccessAction
|
|
|
|
| RunDeadTaskErrorAction
|
2020-12-19 23:38:23 +08:00
|
|
|
| KillScheduledTaskBeginAction
|
|
|
|
| KillScheduledTaskSuccessAction
|
|
|
|
| KillScheduledTaskErrorAction
|
|
|
|
| KillRetryTaskBeginAction
|
|
|
|
| KillRetryTaskSuccessAction
|
|
|
|
| KillRetryTaskErrorAction
|
2020-12-09 22:56:44 +08:00
|
|
|
| DeleteScheduledTaskBeginAction
|
|
|
|
| DeleteScheduledTaskSuccessAction
|
|
|
|
| DeleteScheduledTaskErrorAction
|
2020-12-19 22:07:23 +08:00
|
|
|
| BatchDeleteScheduledTasksBeginAction
|
|
|
|
| BatchDeleteScheduledTasksSuccessAction
|
|
|
|
| BatchDeleteScheduledTasksErrorAction
|
|
|
|
| BatchRunScheduledTasksBeginAction
|
|
|
|
| BatchRunScheduledTasksSuccessAction
|
|
|
|
| BatchRunScheduledTasksErrorAction
|
|
|
|
| RunAllScheduledTasksBeginAction
|
|
|
|
| RunAllScheduledTasksSuccessAction
|
|
|
|
| RunAllScheduledTasksErrorAction
|
2020-12-19 23:38:23 +08:00
|
|
|
| BatchKillScheduledTasksBeginAction
|
|
|
|
| BatchKillScheduledTasksSuccessAction
|
|
|
|
| BatchKillScheduledTasksErrorAction
|
|
|
|
| KillAllScheduledTasksBeginAction
|
|
|
|
| KillAllScheduledTasksSuccessAction
|
|
|
|
| KillAllScheduledTasksErrorAction
|
2020-12-19 22:07:23 +08:00
|
|
|
| DeleteAllScheduledTasksBeginAction
|
|
|
|
| DeleteAllScheduledTasksSuccessAction
|
|
|
|
| DeleteAllScheduledTasksErrorAction
|
2020-12-09 13:22:23 +08:00
|
|
|
| DeleteRetryTaskBeginAction
|
|
|
|
| DeleteRetryTaskSuccessAction
|
2020-12-09 22:56:44 +08:00
|
|
|
| DeleteRetryTaskErrorAction
|
2020-12-19 22:07:23 +08:00
|
|
|
| BatchDeleteRetryTasksBeginAction
|
|
|
|
| BatchDeleteRetryTasksSuccessAction
|
|
|
|
| BatchDeleteRetryTasksErrorAction
|
|
|
|
| BatchRunRetryTasksBeginAction
|
|
|
|
| BatchRunRetryTasksSuccessAction
|
|
|
|
| BatchRunRetryTasksErrorAction
|
|
|
|
| RunAllRetryTasksBeginAction
|
|
|
|
| RunAllRetryTasksSuccessAction
|
|
|
|
| RunAllRetryTasksErrorAction
|
2020-12-19 23:38:23 +08:00
|
|
|
| BatchKillRetryTasksBeginAction
|
|
|
|
| BatchKillRetryTasksSuccessAction
|
|
|
|
| BatchKillRetryTasksErrorAction
|
|
|
|
| KillAllRetryTasksBeginAction
|
|
|
|
| KillAllRetryTasksSuccessAction
|
|
|
|
| KillAllRetryTasksErrorAction
|
2020-12-19 22:07:23 +08:00
|
|
|
| DeleteAllRetryTasksBeginAction
|
|
|
|
| DeleteAllRetryTasksSuccessAction
|
|
|
|
| DeleteAllRetryTasksErrorAction
|
2020-12-09 22:56:44 +08:00
|
|
|
| DeleteDeadTaskBeginAction
|
|
|
|
| DeleteDeadTaskSuccessAction
|
2020-12-13 23:51:40 +08:00
|
|
|
| DeleteDeadTaskErrorAction
|
|
|
|
| BatchDeleteDeadTasksBeginAction
|
|
|
|
| BatchDeleteDeadTasksSuccessAction
|
2020-12-15 22:46:23 +08:00
|
|
|
| BatchDeleteDeadTasksErrorAction
|
|
|
|
| BatchRunDeadTasksBeginAction
|
|
|
|
| BatchRunDeadTasksSuccessAction
|
2020-12-16 22:55:51 +08:00
|
|
|
| BatchRunDeadTasksErrorAction
|
2020-12-17 22:57:30 +08:00
|
|
|
| RunAllDeadTasksBeginAction
|
|
|
|
| RunAllDeadTasksSuccessAction
|
|
|
|
| RunAllDeadTasksErrorAction
|
2020-12-16 22:55:51 +08:00
|
|
|
| DeleteAllDeadTasksBeginAction
|
|
|
|
| DeleteAllDeadTasksSuccessAction
|
|
|
|
| DeleteAllDeadTasksErrorAction;
|
2020-11-24 22:54:00 +08:00
|
|
|
|
2020-11-30 07:04:24 +08:00
|
|
|
export function listActiveTasksAsync(
|
|
|
|
qname: string,
|
|
|
|
pageOpts?: PaginationOptions
|
|
|
|
) {
|
2020-11-24 22:54:00 +08:00
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: LIST_ACTIVE_TASKS_BEGIN, queue: qname });
|
|
|
|
try {
|
2020-11-30 07:04:24 +08:00
|
|
|
const response = await listActiveTasks(qname, pageOpts);
|
2020-11-24 22:54:00 +08:00
|
|
|
dispatch({
|
|
|
|
type: LIST_ACTIVE_TASKS_SUCCESS,
|
|
|
|
queue: qname,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
dispatch({
|
|
|
|
type: LIST_ACTIVE_TASKS_ERROR,
|
|
|
|
queue: qname,
|
|
|
|
error: `Could not retreive active tasks data for queue: ${qname}`,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function listPendingTasksAsync(
|
|
|
|
qname: string,
|
|
|
|
pageOpts?: PaginationOptions
|
|
|
|
) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: LIST_PENDING_TASKS_BEGIN, queue: qname });
|
|
|
|
try {
|
|
|
|
const response = await listPendingTasks(qname, pageOpts);
|
|
|
|
dispatch({
|
|
|
|
type: LIST_PENDING_TASKS_SUCCESS,
|
|
|
|
queue: qname,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
dispatch({
|
|
|
|
type: LIST_PENDING_TASKS_ERROR,
|
|
|
|
queue: qname,
|
|
|
|
error: `Could not retreive pending tasks data for queue: ${qname}`,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function listScheduledTasksAsync(
|
|
|
|
qname: string,
|
|
|
|
pageOpts?: PaginationOptions
|
|
|
|
) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: LIST_SCHEDULED_TASKS_BEGIN, queue: qname });
|
|
|
|
try {
|
|
|
|
const response = await listScheduledTasks(qname, pageOpts);
|
|
|
|
dispatch({
|
|
|
|
type: LIST_SCHEDULED_TASKS_SUCCESS,
|
|
|
|
queue: qname,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
dispatch({
|
|
|
|
type: LIST_SCHEDULED_TASKS_ERROR,
|
|
|
|
queue: qname,
|
|
|
|
error: `Could not retreive scheduled tasks data for queue: ${qname}`,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function listRetryTasksAsync(
|
|
|
|
qname: string,
|
|
|
|
pageOpts?: PaginationOptions
|
|
|
|
) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: LIST_RETRY_TASKS_BEGIN, queue: qname });
|
|
|
|
try {
|
|
|
|
const response = await listRetryTasks(qname, pageOpts);
|
|
|
|
dispatch({
|
|
|
|
type: LIST_RETRY_TASKS_SUCCESS,
|
|
|
|
queue: qname,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
dispatch({
|
|
|
|
type: LIST_RETRY_TASKS_ERROR,
|
|
|
|
queue: qname,
|
|
|
|
error: `Could not retreive retry tasks data for queue: ${qname}`,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function listDeadTasksAsync(
|
|
|
|
qname: string,
|
|
|
|
pageOpts?: PaginationOptions
|
|
|
|
) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: LIST_DEAD_TASKS_BEGIN, queue: qname });
|
|
|
|
try {
|
|
|
|
const response = await listDeadTasks(qname, pageOpts);
|
|
|
|
dispatch({
|
|
|
|
type: LIST_DEAD_TASKS_SUCCESS,
|
|
|
|
queue: qname,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch {
|
|
|
|
dispatch({
|
|
|
|
type: LIST_DEAD_TASKS_ERROR,
|
|
|
|
queue: qname,
|
|
|
|
error: `Could not retreive dead tasks data for queue: ${qname}`,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-12-06 01:24:42 +08:00
|
|
|
|
|
|
|
export function cancelActiveTaskAsync(queue: string, taskId: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: CANCEL_ACTIVE_TASK_BEGIN, queue, taskId });
|
|
|
|
try {
|
|
|
|
await cancelActiveTask(queue, taskId);
|
|
|
|
dispatch({ type: CANCEL_ACTIVE_TASK_SUCCESS, queue, taskId });
|
|
|
|
} catch {
|
|
|
|
dispatch({
|
|
|
|
type: CANCEL_ACTIVE_TASK_ERROR,
|
|
|
|
error: `Could not cancel task: ${taskId}`,
|
|
|
|
queue,
|
|
|
|
taskId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-12-09 13:22:23 +08:00
|
|
|
|
2020-12-19 22:35:08 +08:00
|
|
|
export function runScheduledTaskAsync(queue: string, taskKey: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: RUN_SCHEDULED_TASK_BEGIN, queue, taskKey });
|
|
|
|
try {
|
|
|
|
await runScheduledTask(queue, taskKey);
|
|
|
|
dispatch({ type: RUN_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("runScheduledTaskAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: RUN_SCHEDULED_TASK_ERROR,
|
|
|
|
error: `Could not run task: ${taskKey}`,
|
|
|
|
queue,
|
|
|
|
taskKey,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function runRetryTaskAsync(queue: string, taskKey: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: RUN_RETRY_TASK_BEGIN, queue, taskKey });
|
|
|
|
try {
|
|
|
|
await runRetryTask(queue, taskKey);
|
|
|
|
dispatch({ type: RUN_RETRY_TASK_SUCCESS, queue, taskKey });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("runRetryTaskAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: RUN_RETRY_TASK_ERROR,
|
|
|
|
error: `Could not run task: ${taskKey}`,
|
|
|
|
queue,
|
|
|
|
taskKey,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
export function killScheduledTaskAsync(queue: string, taskKey: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: KILL_SCHEDULED_TASK_BEGIN, queue, taskKey });
|
|
|
|
try {
|
|
|
|
await killScheduledTask(queue, taskKey);
|
|
|
|
dispatch({ type: KILL_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("killScheduledTaskAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: KILL_SCHEDULED_TASK_ERROR,
|
|
|
|
error: `Could not kill task: ${taskKey}`,
|
|
|
|
queue,
|
|
|
|
taskKey,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function killRetryTaskAsync(queue: string, taskKey: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: KILL_RETRY_TASK_BEGIN, queue, taskKey });
|
|
|
|
try {
|
|
|
|
await killRetryTask(queue, taskKey);
|
|
|
|
dispatch({ type: KILL_RETRY_TASK_SUCCESS, queue, taskKey });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("killRetryTaskAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: KILL_RETRY_TASK_ERROR,
|
|
|
|
error: `Could not kill task: ${taskKey}`,
|
|
|
|
queue,
|
|
|
|
taskKey,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-14 23:14:10 +08:00
|
|
|
export function runDeadTaskAsync(queue: string, taskKey: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: RUN_DEAD_TASK_BEGIN, queue, taskKey });
|
|
|
|
try {
|
|
|
|
await runDeadTask(queue, taskKey);
|
|
|
|
dispatch({ type: RUN_DEAD_TASK_SUCCESS, queue, taskKey });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("runDeadTaskAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: RUN_DEAD_TASK_ERROR,
|
|
|
|
error: `Could not run task: ${taskKey}`,
|
|
|
|
queue,
|
|
|
|
taskKey,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-09 22:56:44 +08:00
|
|
|
export function deleteScheduledTaskAsync(queue: string, taskKey: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: DELETE_SCHEDULED_TASK_BEGIN, queue, taskKey });
|
|
|
|
try {
|
|
|
|
await deleteScheduledTask(queue, taskKey);
|
|
|
|
dispatch({ type: DELETE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("deleteScheduledTaskAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: DELETE_SCHEDULED_TASK_ERROR,
|
|
|
|
error: `Could not delete task: ${taskKey}`,
|
|
|
|
queue,
|
|
|
|
taskKey,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-19 22:07:23 +08:00
|
|
|
export function batchDeleteScheduledTasksAsync(
|
|
|
|
queue: string,
|
|
|
|
taskKeys: string[]
|
|
|
|
) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: BATCH_DELETE_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
|
|
|
|
try {
|
|
|
|
const response = await batchDeleteScheduledTasks(queue, taskKeys);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_DELETE_SCHEDULED_TASKS_SUCCESS,
|
|
|
|
queue: queue,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
console.error("batchDeleteScheduledTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_DELETE_SCHEDULED_TASKS_ERROR,
|
|
|
|
error: `Could not batch delete tasks: ${taskKeys}`,
|
|
|
|
queue,
|
|
|
|
taskKeys,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function batchRunScheduledTasksAsync(queue: string, taskKeys: string[]) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: BATCH_RUN_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
|
|
|
|
try {
|
|
|
|
const response = await batchRunScheduledTasks(queue, taskKeys);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_RUN_SCHEDULED_TASKS_SUCCESS,
|
|
|
|
queue: queue,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
console.error("batchRunScheduledTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_RUN_SCHEDULED_TASKS_ERROR,
|
|
|
|
error: `Could not batch run tasks: ${taskKeys}`,
|
|
|
|
queue,
|
|
|
|
taskKeys,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
export function batchKillScheduledTasksAsync(
|
|
|
|
queue: string,
|
|
|
|
taskKeys: string[]
|
|
|
|
) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: BATCH_KILL_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
|
|
|
|
try {
|
|
|
|
const response = await batchKillScheduledTasks(queue, taskKeys);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_KILL_SCHEDULED_TASKS_SUCCESS,
|
|
|
|
queue: queue,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
console.error("batchKillScheduledTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_KILL_SCHEDULED_TASKS_ERROR,
|
|
|
|
error: `Could not batch kill tasks: ${taskKeys}`,
|
|
|
|
queue,
|
|
|
|
taskKeys,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-19 22:07:23 +08:00
|
|
|
export function deleteAllScheduledTasksAsync(queue: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: DELETE_ALL_SCHEDULED_TASKS_BEGIN, queue });
|
|
|
|
try {
|
|
|
|
await deleteAllScheduledTasks(queue);
|
|
|
|
dispatch({ type: DELETE_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("deleteAllScheduledTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: DELETE_ALL_SCHEDULED_TASKS_ERROR,
|
|
|
|
error: `Could not delete all scheduled tasks`,
|
|
|
|
queue,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function runAllScheduledTasksAsync(queue: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_BEGIN, queue });
|
|
|
|
try {
|
|
|
|
await runAllScheduledTasks(queue);
|
|
|
|
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("runAllScheduledTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: RUN_ALL_SCHEDULED_TASKS_ERROR,
|
|
|
|
error: `Could not run all scheduled tasks`,
|
|
|
|
queue,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
export function killAllScheduledTasksAsync(queue: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_BEGIN, queue });
|
|
|
|
try {
|
|
|
|
await killAllScheduledTasks(queue);
|
|
|
|
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("killAllScheduledTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: RUN_ALL_SCHEDULED_TASKS_ERROR,
|
|
|
|
error: `Could not kill all scheduled tasks`,
|
|
|
|
queue,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-09 13:22:23 +08:00
|
|
|
export function deleteRetryTaskAsync(queue: string, taskKey: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: DELETE_RETRY_TASK_BEGIN, queue, taskKey });
|
|
|
|
try {
|
|
|
|
await deleteRetryTask(queue, taskKey);
|
|
|
|
dispatch({ type: DELETE_RETRY_TASK_SUCCESS, queue, taskKey });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("deleteRetryTaskAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: DELETE_RETRY_TASK_ERROR,
|
|
|
|
error: `Could not delete task: ${taskKey}`,
|
|
|
|
queue,
|
|
|
|
taskKey,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-12-09 22:56:44 +08:00
|
|
|
|
2020-12-19 22:07:23 +08:00
|
|
|
export function batchDeleteRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: BATCH_DELETE_RETRY_TASKS_BEGIN, queue, taskKeys });
|
|
|
|
try {
|
|
|
|
const response = await batchDeleteRetryTasks(queue, taskKeys);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_DELETE_RETRY_TASKS_SUCCESS,
|
|
|
|
queue: queue,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
console.error("batchDeleteRetryTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_DELETE_RETRY_TASKS_ERROR,
|
|
|
|
error: `Could not batch delete tasks: ${taskKeys}`,
|
|
|
|
queue,
|
|
|
|
taskKeys,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function batchRunRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: BATCH_RUN_RETRY_TASKS_BEGIN, queue, taskKeys });
|
|
|
|
try {
|
|
|
|
const response = await batchRunRetryTasks(queue, taskKeys);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_RUN_RETRY_TASKS_SUCCESS,
|
|
|
|
queue: queue,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
console.error("batchRunRetryTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_RUN_RETRY_TASKS_ERROR,
|
|
|
|
error: `Could not batch run tasks: ${taskKeys}`,
|
|
|
|
queue,
|
|
|
|
taskKeys,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
export function batchKillRetryTasksAsync(queue: string, taskKeys: string[]) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: BATCH_KILL_RETRY_TASKS_BEGIN, queue, taskKeys });
|
|
|
|
try {
|
|
|
|
const response = await batchKillRetryTasks(queue, taskKeys);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_KILL_RETRY_TASKS_SUCCESS,
|
|
|
|
queue: queue,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
console.error("batchKillRetryTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_KILL_RETRY_TASKS_ERROR,
|
|
|
|
error: `Could not batch kill tasks: ${taskKeys}`,
|
|
|
|
queue,
|
|
|
|
taskKeys,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-19 22:07:23 +08:00
|
|
|
export function deleteAllRetryTasksAsync(queue: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: DELETE_ALL_RETRY_TASKS_BEGIN, queue });
|
|
|
|
try {
|
|
|
|
await deleteAllRetryTasks(queue);
|
|
|
|
dispatch({ type: DELETE_ALL_RETRY_TASKS_SUCCESS, queue });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("deleteAllRetryTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: DELETE_ALL_RETRY_TASKS_ERROR,
|
|
|
|
error: `Could not delete all retry tasks`,
|
|
|
|
queue,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function runAllRetryTasksAsync(queue: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: RUN_ALL_RETRY_TASKS_BEGIN, queue });
|
|
|
|
try {
|
|
|
|
await runAllRetryTasks(queue);
|
|
|
|
dispatch({ type: RUN_ALL_RETRY_TASKS_SUCCESS, queue });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("runAllRetryTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: RUN_ALL_RETRY_TASKS_ERROR,
|
|
|
|
error: `Could not run all retry tasks`,
|
|
|
|
queue,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-19 23:38:23 +08:00
|
|
|
export function killAllRetryTasksAsync(queue: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: KILL_ALL_RETRY_TASKS_BEGIN, queue });
|
|
|
|
try {
|
|
|
|
await killAllRetryTasks(queue);
|
|
|
|
dispatch({ type: KILL_ALL_RETRY_TASKS_SUCCESS, queue });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("killAllRetryTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: KILL_ALL_RETRY_TASKS_ERROR,
|
|
|
|
error: `Could not kill all retry tasks`,
|
|
|
|
queue,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-12-09 22:56:44 +08:00
|
|
|
export function deleteDeadTaskAsync(queue: string, taskKey: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: DELETE_DEAD_TASK_BEGIN, queue, taskKey });
|
|
|
|
try {
|
|
|
|
await deleteDeadTask(queue, taskKey);
|
|
|
|
dispatch({ type: DELETE_DEAD_TASK_SUCCESS, queue, taskKey });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("deleteDeadTaskAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: DELETE_DEAD_TASK_ERROR,
|
|
|
|
error: `Could not delete task: ${taskKey}`,
|
|
|
|
queue,
|
|
|
|
taskKey,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-12-13 23:51:40 +08:00
|
|
|
|
|
|
|
export function batchDeleteDeadTasksAsync(queue: string, taskKeys: string[]) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: BATCH_DELETE_DEAD_TASKS_BEGIN, queue, taskKeys });
|
|
|
|
try {
|
|
|
|
const response = await batchDeleteDeadTasks(queue, taskKeys);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_DELETE_DEAD_TASKS_SUCCESS,
|
|
|
|
queue: queue,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
console.error("batchDeleteDeadTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_DELETE_DEAD_TASKS_ERROR,
|
|
|
|
error: `Could not batch delete tasks: ${taskKeys}`,
|
|
|
|
queue,
|
|
|
|
taskKeys,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-12-15 22:46:23 +08:00
|
|
|
|
|
|
|
export function batchRunDeadTasksAsync(queue: string, taskKeys: string[]) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: BATCH_RUN_DEAD_TASKS_BEGIN, queue, taskKeys });
|
|
|
|
try {
|
|
|
|
const response = await batchRunDeadTasks(queue, taskKeys);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_RUN_DEAD_TASKS_SUCCESS,
|
|
|
|
queue: queue,
|
|
|
|
payload: response,
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
console.error("batchRunDeadTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: BATCH_RUN_DEAD_TASKS_ERROR,
|
|
|
|
error: `Could not batch run tasks: ${taskKeys}`,
|
|
|
|
queue,
|
|
|
|
taskKeys,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-12-16 22:55:51 +08:00
|
|
|
|
|
|
|
export function deleteAllDeadTasksAsync(queue: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: DELETE_ALL_DEAD_TASKS_BEGIN, queue });
|
|
|
|
try {
|
|
|
|
await deleteAllDeadTasks(queue);
|
|
|
|
dispatch({ type: DELETE_ALL_DEAD_TASKS_SUCCESS, queue });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("deleteAllDeadTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: DELETE_ALL_DEAD_TASKS_ERROR,
|
|
|
|
error: `Could not delete all dead tasks`,
|
|
|
|
queue,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-12-17 22:57:30 +08:00
|
|
|
|
|
|
|
export function runAllDeadTasksAsync(queue: string) {
|
|
|
|
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
|
|
|
dispatch({ type: RUN_ALL_DEAD_TASKS_BEGIN, queue });
|
|
|
|
try {
|
|
|
|
await runAllDeadTasks(queue);
|
|
|
|
dispatch({ type: RUN_ALL_DEAD_TASKS_SUCCESS, queue });
|
|
|
|
} catch (error) {
|
|
|
|
console.error("runAllDeadTasksAsync: ", error);
|
|
|
|
dispatch({
|
|
|
|
type: RUN_ALL_DEAD_TASKS_ERROR,
|
|
|
|
error: `Could not run all dead tasks`,
|
|
|
|
queue,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|