mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-18 18:55:54 +08:00
Rename DeadTask to ArchivedTask, and action Kill to Archive
This commit is contained in:
parent
95eb3e0855
commit
34b6553d7d
@ -22,7 +22,7 @@ type QueueStateSnapshot struct {
|
||||
Pending int `json:"pending"`
|
||||
Scheduled int `json:"scheduled"`
|
||||
Retry int `json:"retry"`
|
||||
Dead int `json:"dead"`
|
||||
Archived int `json:"archived"`
|
||||
|
||||
// Total number of tasks processed during the given date.
|
||||
// The number includes both succeeded and failed tasks.
|
||||
@ -45,7 +45,7 @@ func toQueueStateSnapshot(s *asynq.QueueStats) *QueueStateSnapshot {
|
||||
Pending: s.Pending,
|
||||
Scheduled: s.Scheduled,
|
||||
Retry: s.Retry,
|
||||
Dead: s.Dead,
|
||||
Archived: s.Archived,
|
||||
Processed: s.Processed,
|
||||
Succeeded: s.Processed - s.Failed,
|
||||
Failed: s.Failed,
|
||||
@ -193,7 +193,7 @@ func toRetryTasks(in []*asynq.RetryTask) []*RetryTask {
|
||||
return out
|
||||
}
|
||||
|
||||
type DeadTask struct {
|
||||
type ArchivedTask struct {
|
||||
*BaseTask
|
||||
Key string `json:"key"`
|
||||
MaxRetry int `json:"max_retry"`
|
||||
@ -202,14 +202,14 @@ type DeadTask struct {
|
||||
LastFailedAt time.Time `json:"last_failed_at"`
|
||||
}
|
||||
|
||||
func toDeadTask(t *asynq.DeadTask) *DeadTask {
|
||||
func toArchivedTask(t *asynq.ArchivedTask) *ArchivedTask {
|
||||
base := &BaseTask{
|
||||
ID: t.ID,
|
||||
Type: t.Type,
|
||||
Payload: t.Payload,
|
||||
Queue: t.Queue,
|
||||
}
|
||||
return &DeadTask{
|
||||
return &ArchivedTask{
|
||||
BaseTask: base,
|
||||
Key: t.Key(),
|
||||
MaxRetry: t.MaxRetry,
|
||||
@ -219,10 +219,10 @@ func toDeadTask(t *asynq.DeadTask) *DeadTask {
|
||||
}
|
||||
}
|
||||
|
||||
func toDeadTasks(in []*asynq.DeadTask) []*DeadTask {
|
||||
out := make([]*DeadTask, len(in))
|
||||
func toArchivedTasks(in []*asynq.ArchivedTask) []*ArchivedTask {
|
||||
out := make([]*ArchivedTask, len(in))
|
||||
for i, t := range in {
|
||||
out[i] = toDeadTask(t)
|
||||
out[i] = toArchivedTask(t)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
26
main.go
26
main.go
@ -138,9 +138,9 @@ func main() {
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks/{task_key}:run", newRunTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks:run_all", newRunAllScheduledTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks:batch_run", newBatchRunTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks/{task_key}:kill", newKillTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks:kill_all", newKillAllScheduledTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks:batch_kill", newBatchKillTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks/{task_key}:archive", newArchiveTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks:archive_all", newArchiveAllScheduledTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks:batch_archive", newBatchArchiveTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks", newListRetryTasksHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks:delete_all", newDeleteAllRetryTasksHandlerFunc(inspector)).Methods("DELETE")
|
||||
@ -148,16 +148,16 @@ func main() {
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks/{task_key}:run", newRunTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks:run_all", newRunAllRetryTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks:batch_run", newBatchRunTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks/{task_key}:kill", newKillTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks:kill_all", newKillAllRetryTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks:batch_kill", newBatchKillTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/dead_tasks", newListDeadTasksHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}/dead_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE")
|
||||
api.HandleFunc("/queues/{qname}/dead_tasks:delete_all", newDeleteAllDeadTasksHandlerFunc(inspector)).Methods("DELETE")
|
||||
api.HandleFunc("/queues/{qname}/dead_tasks:batch_delete", newBatchDeleteTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/dead_tasks/{task_key}:run", newRunTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/dead_tasks:run_all", newRunAllDeadTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/dead_tasks:batch_run", newBatchRunTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks/{task_key}:archive", newArchiveTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks:archive_all", newArchiveAllRetryTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks:batch_archive", newBatchArchiveTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/archived_tasks", newListArchivedTasksHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}/archived_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE")
|
||||
api.HandleFunc("/queues/{qname}/archived_tasks:delete_all", newDeleteAllArchivedTasksHandlerFunc(inspector)).Methods("DELETE")
|
||||
api.HandleFunc("/queues/{qname}/archived_tasks:batch_delete", newBatchDeleteTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/archived_tasks/{task_key}:run", newRunTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/archived_tasks:run_all", newRunAllArchivedTasksHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/archived_tasks:batch_run", newBatchRunTasksHandlerFunc(inspector)).Methods("POST")
|
||||
|
||||
// Servers endpoints.
|
||||
api.HandleFunc("/servers", newListServersHandlerFunc(inspector)).Methods("GET")
|
||||
|
@ -217,12 +217,12 @@ func newListRetryTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func newListDeadTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
func newListArchivedTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
qname := vars["qname"]
|
||||
pageSize, pageNum := getPageOptions(r)
|
||||
tasks, err := inspector.ListDeadTasks(
|
||||
tasks, err := inspector.ListArchivedTasks(
|
||||
qname, asynq.PageSize(pageSize), asynq.Page(pageNum))
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
@ -236,9 +236,9 @@ func newListDeadTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
payload := make(map[string]interface{})
|
||||
if len(tasks) == 0 {
|
||||
// avoid nil for the tasks field in json output.
|
||||
payload["tasks"] = make([]*DeadTask, 0)
|
||||
payload["tasks"] = make([]*ArchivedTask, 0)
|
||||
} else {
|
||||
payload["tasks"] = toDeadTasks(tasks)
|
||||
payload["tasks"] = toArchivedTasks(tasks)
|
||||
}
|
||||
payload["stats"] = toQueueStateSnapshot(stats)
|
||||
if err := json.NewEncoder(w).Encode(payload); err != nil {
|
||||
@ -282,7 +282,7 @@ func newRunTaskHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func newKillTaskHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
func newArchiveTaskHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
qname, key := vars["qname"], vars["task_key"]
|
||||
@ -290,7 +290,7 @@ func newKillTaskHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
http.Error(w, "route parameters should not be empty", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if err := inspector.KillTaskByKey(qname, key); err != nil {
|
||||
if err := inspector.ArchiveTaskByKey(qname, key); err != nil {
|
||||
// TODO: Handle task not found error and return 404
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
@ -321,10 +321,10 @@ func newDeleteAllRetryTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerF
|
||||
}
|
||||
}
|
||||
|
||||
func newDeleteAllDeadTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
func newDeleteAllArchivedTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
qname := mux.Vars(r)["qname"]
|
||||
if _, err := inspector.DeleteAllDeadTasks(qname); err != nil {
|
||||
if _, err := inspector.DeleteAllArchivedTasks(qname); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
@ -354,10 +354,10 @@ func newRunAllRetryTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc
|
||||
}
|
||||
}
|
||||
|
||||
func newRunAllDeadTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
func newRunAllArchivedTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
qname := mux.Vars(r)["qname"]
|
||||
if _, err := inspector.RunAllDeadTasks(qname); err != nil {
|
||||
if _, err := inspector.RunAllArchivedTasks(qname); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
@ -365,10 +365,10 @@ func newRunAllDeadTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc
|
||||
}
|
||||
}
|
||||
|
||||
func newKillAllScheduledTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
func newArchiveAllScheduledTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
qname := mux.Vars(r)["qname"]
|
||||
if _, err := inspector.KillAllScheduledTasks(qname); err != nil {
|
||||
if _, err := inspector.ArchiveAllScheduledTasks(qname); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
@ -376,10 +376,10 @@ func newKillAllScheduledTasksHandlerFunc(inspector *asynq.Inspector) http.Handle
|
||||
}
|
||||
}
|
||||
|
||||
func newKillAllRetryTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
func newArchiveAllRetryTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
qname := mux.Vars(r)["qname"]
|
||||
if _, err := inspector.KillAllRetryTasks(qname); err != nil {
|
||||
if _, err := inspector.ArchiveAllRetryTasks(qname); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
@ -485,41 +485,41 @@ func newBatchRunTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
type batchKillTasksRequest struct {
|
||||
type batchArchiveTasksRequest struct {
|
||||
TaskKeys []string `json:"task_keys"`
|
||||
}
|
||||
|
||||
type batchKillTasksResponse struct {
|
||||
// task keys that were successfully moved to the dead state.
|
||||
DeadKeys []string `json:"dead_keys"`
|
||||
// task keys that were not able to move to the dead state.
|
||||
type batchArchiveTasksResponse struct {
|
||||
// task keys that were successfully moved to the archived state.
|
||||
ArchivedKeys []string `json:"archived_keys"`
|
||||
// task keys that were not able to move to the archived state.
|
||||
ErrorKeys []string `json:"error_keys"`
|
||||
}
|
||||
|
||||
func newBatchKillTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
func newBatchArchiveTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
r.Body = http.MaxBytesReader(w, r.Body, maxRequestBodySize)
|
||||
dec := json.NewDecoder(r.Body)
|
||||
dec.DisallowUnknownFields()
|
||||
|
||||
var req batchKillTasksRequest
|
||||
var req batchArchiveTasksRequest
|
||||
if err := dec.Decode(&req); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
qname := mux.Vars(r)["qname"]
|
||||
resp := batchKillTasksResponse{
|
||||
resp := batchArchiveTasksResponse{
|
||||
// avoid null in the json response
|
||||
DeadKeys: make([]string, 0),
|
||||
ErrorKeys: make([]string, 0),
|
||||
ArchivedKeys: make([]string, 0),
|
||||
ErrorKeys: make([]string, 0),
|
||||
}
|
||||
for _, key := range req.TaskKeys {
|
||||
if err := inspector.KillTaskByKey(qname, key); err != nil {
|
||||
log.Printf("error: could not kill task with key %q: %v", key, err)
|
||||
if err := inspector.ArchiveTaskByKey(qname, key); err != nil {
|
||||
log.Printf("error: could not archive task with key %q: %v", key, err)
|
||||
resp.ErrorKeys = append(resp.ErrorKeys, key)
|
||||
} else {
|
||||
resp.DeadKeys = append(resp.DeadKeys, key)
|
||||
resp.ArchivedKeys = append(resp.ArchivedKeys, key)
|
||||
}
|
||||
}
|
||||
if err := json.NewEncoder(w).Encode(resp); err != nil {
|
||||
|
@ -46,7 +46,7 @@
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not archived",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
|
@ -1,33 +1,33 @@
|
||||
import {
|
||||
batchCancelActiveTasks,
|
||||
BatchCancelTasksResponse,
|
||||
batchDeleteDeadTasks,
|
||||
batchDeleteArchivedTasks,
|
||||
batchDeleteRetryTasks,
|
||||
batchDeleteScheduledTasks,
|
||||
BatchDeleteTasksResponse,
|
||||
batchKillRetryTasks,
|
||||
batchKillScheduledTasks,
|
||||
BatchKillTasksResponse,
|
||||
batchRunDeadTasks,
|
||||
batchArchiveRetryTasks,
|
||||
batchArchiveScheduledTasks,
|
||||
BatchArchiveTasksResponse,
|
||||
batchRunArchivedTasks,
|
||||
batchRunRetryTasks,
|
||||
batchRunScheduledTasks,
|
||||
BatchRunTasksResponse,
|
||||
cancelActiveTask,
|
||||
cancelAllActiveTasks,
|
||||
deleteAllDeadTasks,
|
||||
deleteAllArchivedTasks,
|
||||
deleteAllRetryTasks,
|
||||
deleteAllScheduledTasks,
|
||||
deleteDeadTask,
|
||||
deleteArchivedTask,
|
||||
deleteRetryTask,
|
||||
deleteScheduledTask,
|
||||
killAllRetryTasks,
|
||||
killAllScheduledTasks,
|
||||
killRetryTask,
|
||||
killScheduledTask,
|
||||
archiveAllRetryTasks,
|
||||
archiveAllScheduledTasks,
|
||||
archiveRetryTask,
|
||||
archiveScheduledTask,
|
||||
listActiveTasks,
|
||||
ListActiveTasksResponse,
|
||||
listDeadTasks,
|
||||
ListDeadTasksResponse,
|
||||
listArchivedTasks,
|
||||
ListArchivedTasksResponse,
|
||||
listPendingTasks,
|
||||
ListPendingTasksResponse,
|
||||
listRetryTasks,
|
||||
@ -35,10 +35,10 @@ import {
|
||||
listScheduledTasks,
|
||||
ListScheduledTasksResponse,
|
||||
PaginationOptions,
|
||||
runAllDeadTasks,
|
||||
runAllArchivedTasks,
|
||||
runAllRetryTasks,
|
||||
runAllScheduledTasks,
|
||||
runDeadTask,
|
||||
runArchivedTask,
|
||||
runRetryTask,
|
||||
runScheduledTask,
|
||||
} from "../api";
|
||||
@ -57,9 +57,9 @@ 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";
|
||||
export const LIST_ARCHIVED_TASKS_BEGIN = "LIST_ARCHIVED_TASKS_BEGIN";
|
||||
export const LIST_ARCHIVED_TASKS_SUCCESS = "LIST_ARCHIVED_TASKS_SUCCESS";
|
||||
export const LIST_ARCHIVED_TASKS_ERROR = "LIST_ARCHIVED_TASKS_ERROR";
|
||||
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";
|
||||
@ -73,35 +73,35 @@ export const BATCH_CANCEL_ACTIVE_TASKS_SUCCESS =
|
||||
"BATCH_CANCEL_ACTIVE_TASKS_SUCCESS";
|
||||
export const BATCH_CANCEL_ACTIVE_TASKS_ERROR =
|
||||
"BATCH_CANCEL_ACTIVE_TASKS_ERROR";
|
||||
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_SCHEDULED_TASK_BEGIN = "RUN_ARCHIVED_TASK_BEGIN";
|
||||
export const RUN_SCHEDULED_TASK_SUCCESS = "RUN_ARCHIVED_TASK_SUCCESS";
|
||||
export const RUN_SCHEDULED_TASK_ERROR = "RUN_ARCHIVED_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";
|
||||
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";
|
||||
export const RUN_ARCHIVED_TASK_BEGIN = "RUN_ARCHIVED_TASK_BEGIN";
|
||||
export const RUN_ARCHIVED_TASK_SUCCESS = "RUN_ARCHIVED_TASK_SUCCESS";
|
||||
export const RUN_ARCHIVED_TASK_ERROR = "RUN_ARCHIVED_TASK_ERROR";
|
||||
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";
|
||||
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";
|
||||
export const ARCHIVE_SCHEDULED_TASK_BEGIN = "ARCHIVE_ARCHIVED_TASK_BEGIN";
|
||||
export const ARCHIVE_SCHEDULED_TASK_SUCCESS = "ARCHIVE_ARCHIVED_TASK_SUCCESS";
|
||||
export const ARCHIVE_SCHEDULED_TASK_ERROR = "ARCHIVE_ARCHIVED_TASK_ERROR";
|
||||
export const ARCHIVE_RETRY_TASK_BEGIN = "ARCHIVE_RETRY_TASK_BEGIN";
|
||||
export const ARCHIVE_RETRY_TASK_SUCCESS = "ARCHIVE_RETRY_TASK_SUCCESS";
|
||||
export const ARCHIVE_RETRY_TASK_ERROR = "ARCHIVE_RETRY_TASK_ERROR";
|
||||
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";
|
||||
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 =
|
||||
export const BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN =
|
||||
"BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN";
|
||||
export const BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS =
|
||||
"BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS";
|
||||
export const BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR =
|
||||
"BATCH_RUN_SCHEDULED_TASKS_ERROR";
|
||||
export const BATCH_DELETE_SCHEDULED_TASKS_BEGIN =
|
||||
"BATCH_DELETE_SCHEDULED_TASKS_BEGIN";
|
||||
@ -113,10 +113,12 @@ 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";
|
||||
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";
|
||||
export const ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN =
|
||||
"ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN";
|
||||
export const ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS =
|
||||
"ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS";
|
||||
export const ARCHIVE_ALL_SCHEDULED_TASKS_ERROR =
|
||||
"ARCHIVE_ALL_SCHEDULED_TASKS_ERROR";
|
||||
export const DELETE_ALL_SCHEDULED_TASKS_BEGIN =
|
||||
"DELETE_ALL_SCHEDULED_TASKS_BEGIN";
|
||||
export const DELETE_ALL_SCHEDULED_TASKS_SUCCESS =
|
||||
@ -129,9 +131,12 @@ export const DELETE_RETRY_TASK_ERROR = "DELETE_RETRY_TASK_ERROR";
|
||||
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";
|
||||
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";
|
||||
export const BATCH_ARCHIVE_RETRY_TASKS_BEGIN =
|
||||
"BATCH_ARCHIVE_RETRY_TASKS_BEGIN";
|
||||
export const BATCH_ARCHIVE_RETRY_TASKS_SUCCESS =
|
||||
"BATCH_ARCHIVE_RETRY_TASKS_SUCCESS";
|
||||
export const BATCH_ARCHIVE_RETRY_TASKS_ERROR =
|
||||
"BATCH_ARCHIVE_RETRY_TASKS_ERROR";
|
||||
export const BATCH_DELETE_RETRY_TASKS_BEGIN = "BATCH_DELETE_RETRY_TASKS_BEGIN";
|
||||
export const BATCH_DELETE_RETRY_TASKS_SUCCESS =
|
||||
"BATCH_DELETE_RETRY_TASKS_SUCCESS";
|
||||
@ -139,28 +144,35 @@ 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";
|
||||
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";
|
||||
export const ARCHIVE_ALL_RETRY_TASKS_BEGIN = "ARCHIVE_ALL_RETRY_TASKS_BEGIN";
|
||||
export const ARCHIVE_ALL_RETRY_TASKS_SUCCESS =
|
||||
"ARCHIVE_ALL_RETRY_TASKS_SUCCESS";
|
||||
export const ARCHIVE_ALL_RETRY_TASKS_ERROR = "ARCHIVE_ALL_RETRY_TASKS_ERROR";
|
||||
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";
|
||||
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";
|
||||
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";
|
||||
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";
|
||||
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";
|
||||
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";
|
||||
export const DELETE_ARCHIVED_TASK_BEGIN = "DELETE_ARCHIVED_TASK_BEGIN";
|
||||
export const DELETE_ARCHIVED_TASK_SUCCESS = "DELETE_ARCHIVED_TASK_SUCCESS";
|
||||
export const DELETE_ARCHIVED_TASK_ERROR = "DELETE_ARCHIVED_TASK_ERROR";
|
||||
export const BATCH_RUN_ARCHIVED_TASKS_BEGIN = "BATCH_RUN_ARCHIVED_TASKS_BEGIN";
|
||||
export const BATCH_RUN_ARCHIVED_TASKS_SUCCESS =
|
||||
"BATCH_RUN_ARCHIVED_TASKS_SUCCESS";
|
||||
export const BATCH_RUN_ARCHIVED_TASKS_ERROR = "BATCH_RUN_ARCHIVED_TASKS_ERROR";
|
||||
export const BATCH_DELETE_ARCHIVED_TASKS_BEGIN =
|
||||
"BATCH_DELETE_ARCHIVED_TASKS_BEGIN";
|
||||
export const BATCH_DELETE_ARCHIVED_TASKS_SUCCESS =
|
||||
"BATCH_DELETE_ARCHIVED_TASKS_SUCCESS";
|
||||
export const BATCH_DELETE_ARCHIVED_TASKS_ERROR =
|
||||
"BATCH_DELETE_ARCHIVED_TASKS_ERROR";
|
||||
export const RUN_ALL_ARCHIVED_TASKS_BEGIN = "RUN_ALL_ARCHIVED_TASKS_BEGIN";
|
||||
export const RUN_ALL_ARCHIVED_TASKS_SUCCESS = "RUN_ALL_ARCHIVED_TASKS_SUCCESS";
|
||||
export const RUN_ALL_ARCHIVED_TASKS_ERROR = "RUN_ALL_ARCHIVED_TASKS_ERROR";
|
||||
export const DELETE_ALL_ARCHIVED_TASKS_BEGIN =
|
||||
"DELETE_ALL_ARCHIVED_TASKS_BEGIN";
|
||||
export const DELETE_ALL_ARCHIVED_TASKS_SUCCESS =
|
||||
"DELETE_ALL_ARCHIVED_TASKS_SUCCESS";
|
||||
export const DELETE_ALL_ARCHIVED_TASKS_ERROR =
|
||||
"DELETE_ALL_ARCHIVED_TASKS_ERROR";
|
||||
|
||||
interface ListActiveTasksBeginAction {
|
||||
type: typeof LIST_ACTIVE_TASKS_BEGIN;
|
||||
@ -230,19 +242,19 @@ interface ListRetryTasksErrorAction {
|
||||
error: string; // error description
|
||||
}
|
||||
|
||||
interface ListDeadTasksBeginAction {
|
||||
type: typeof LIST_DEAD_TASKS_BEGIN;
|
||||
interface ListArchivedTasksBeginAction {
|
||||
type: typeof LIST_ARCHIVED_TASKS_BEGIN;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface ListDeadTasksSuccessAction {
|
||||
type: typeof LIST_DEAD_TASKS_SUCCESS;
|
||||
interface ListArchivedTasksSuccessAction {
|
||||
type: typeof LIST_ARCHIVED_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
payload: ListDeadTasksResponse;
|
||||
payload: ListArchivedTasksResponse;
|
||||
}
|
||||
|
||||
interface ListDeadTasksErrorAction {
|
||||
type: typeof LIST_DEAD_TASKS_ERROR;
|
||||
interface ListArchivedTasksErrorAction {
|
||||
type: typeof LIST_ARCHIVED_TASKS_ERROR;
|
||||
queue: string;
|
||||
error: string; // error description
|
||||
}
|
||||
@ -320,20 +332,20 @@ interface RunScheduledTaskErrorAction {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface KillScheduledTaskBeginAction {
|
||||
type: typeof KILL_SCHEDULED_TASK_BEGIN;
|
||||
interface ArchiveScheduledTaskBeginAction {
|
||||
type: typeof ARCHIVE_SCHEDULED_TASK_BEGIN;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
}
|
||||
|
||||
interface KillScheduledTaskSuccessAction {
|
||||
type: typeof KILL_SCHEDULED_TASK_SUCCESS;
|
||||
interface ArchiveScheduledTaskSuccessAction {
|
||||
type: typeof ARCHIVE_SCHEDULED_TASK_SUCCESS;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
}
|
||||
|
||||
interface KillScheduledTaskErrorAction {
|
||||
type: typeof KILL_SCHEDULED_TASK_ERROR;
|
||||
interface ArchiveScheduledTaskErrorAction {
|
||||
type: typeof ARCHIVE_SCHEDULED_TASK_ERROR;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
error: string;
|
||||
@ -358,39 +370,39 @@ interface RunRetryTaskErrorAction {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface KillRetryTaskBeginAction {
|
||||
type: typeof KILL_RETRY_TASK_BEGIN;
|
||||
interface ArchiveRetryTaskBeginAction {
|
||||
type: typeof ARCHIVE_RETRY_TASK_BEGIN;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
}
|
||||
|
||||
interface KillRetryTaskSuccessAction {
|
||||
type: typeof KILL_RETRY_TASK_SUCCESS;
|
||||
interface ArchiveRetryTaskSuccessAction {
|
||||
type: typeof ARCHIVE_RETRY_TASK_SUCCESS;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
}
|
||||
|
||||
interface KillRetryTaskErrorAction {
|
||||
type: typeof KILL_RETRY_TASK_ERROR;
|
||||
interface ArchiveRetryTaskErrorAction {
|
||||
type: typeof ARCHIVE_RETRY_TASK_ERROR;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface RunDeadTaskBeginAction {
|
||||
type: typeof RUN_DEAD_TASK_BEGIN;
|
||||
interface RunArchivedTaskBeginAction {
|
||||
type: typeof RUN_ARCHIVED_TASK_BEGIN;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
}
|
||||
|
||||
interface RunDeadTaskSuccessAction {
|
||||
type: typeof RUN_DEAD_TASK_SUCCESS;
|
||||
interface RunArchivedTaskSuccessAction {
|
||||
type: typeof RUN_ARCHIVED_TASK_SUCCESS;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
}
|
||||
|
||||
interface RunDeadTaskErrorAction {
|
||||
type: typeof RUN_DEAD_TASK_ERROR;
|
||||
interface RunArchivedTaskErrorAction {
|
||||
type: typeof RUN_ARCHIVED_TASK_ERROR;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
error: string;
|
||||
@ -469,37 +481,37 @@ interface RunAllScheduledTasksErrorAction {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface BatchKillScheduledTasksBeginAction {
|
||||
type: typeof BATCH_KILL_SCHEDULED_TASKS_BEGIN;
|
||||
interface BatchArchiveScheduledTasksBeginAction {
|
||||
type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN;
|
||||
queue: string;
|
||||
taskKeys: string[];
|
||||
}
|
||||
|
||||
interface BatchKillScheduledTasksSuccessAction {
|
||||
type: typeof BATCH_KILL_SCHEDULED_TASKS_SUCCESS;
|
||||
interface BatchArchiveScheduledTasksSuccessAction {
|
||||
type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
payload: BatchKillTasksResponse;
|
||||
payload: BatchArchiveTasksResponse;
|
||||
}
|
||||
|
||||
interface BatchKillScheduledTasksErrorAction {
|
||||
type: typeof BATCH_KILL_SCHEDULED_TASKS_ERROR;
|
||||
interface BatchArchiveScheduledTasksErrorAction {
|
||||
type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR;
|
||||
queue: string;
|
||||
taskKeys: string[];
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface KillAllScheduledTasksBeginAction {
|
||||
type: typeof KILL_ALL_SCHEDULED_TASKS_BEGIN;
|
||||
interface ArchiveAllScheduledTasksBeginAction {
|
||||
type: typeof ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface KillAllScheduledTasksSuccessAction {
|
||||
type: typeof KILL_ALL_SCHEDULED_TASKS_SUCCESS;
|
||||
interface ArchiveAllScheduledTasksSuccessAction {
|
||||
type: typeof ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface KillAllScheduledTasksErrorAction {
|
||||
type: typeof KILL_ALL_SCHEDULED_TASKS_ERROR;
|
||||
interface ArchiveAllScheduledTasksErrorAction {
|
||||
type: typeof ARCHIVE_ALL_SCHEDULED_TASKS_ERROR;
|
||||
queue: string;
|
||||
error: string;
|
||||
}
|
||||
@ -593,37 +605,37 @@ interface RunAllRetryTasksErrorAction {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface BatchKillRetryTasksBeginAction {
|
||||
type: typeof BATCH_KILL_RETRY_TASKS_BEGIN;
|
||||
interface BatchArchiveRetryTasksBeginAction {
|
||||
type: typeof BATCH_ARCHIVE_RETRY_TASKS_BEGIN;
|
||||
queue: string;
|
||||
taskKeys: string[];
|
||||
}
|
||||
|
||||
interface BatchKillRetryTasksSuccessAction {
|
||||
type: typeof BATCH_KILL_RETRY_TASKS_SUCCESS;
|
||||
interface BatchArchiveRetryTasksSuccessAction {
|
||||
type: typeof BATCH_ARCHIVE_RETRY_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
payload: BatchKillTasksResponse;
|
||||
payload: BatchArchiveTasksResponse;
|
||||
}
|
||||
|
||||
interface BatchKillRetryTasksErrorAction {
|
||||
type: typeof BATCH_KILL_RETRY_TASKS_ERROR;
|
||||
interface BatchArchiveRetryTasksErrorAction {
|
||||
type: typeof BATCH_ARCHIVE_RETRY_TASKS_ERROR;
|
||||
queue: string;
|
||||
taskKeys: string[];
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface KillAllRetryTasksBeginAction {
|
||||
type: typeof KILL_ALL_RETRY_TASKS_BEGIN;
|
||||
interface ArchiveAllRetryTasksBeginAction {
|
||||
type: typeof ARCHIVE_ALL_RETRY_TASKS_BEGIN;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface KillAllRetryTasksSuccessAction {
|
||||
type: typeof KILL_ALL_RETRY_TASKS_SUCCESS;
|
||||
interface ArchiveAllRetryTasksSuccessAction {
|
||||
type: typeof ARCHIVE_ALL_RETRY_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface KillAllRetryTasksErrorAction {
|
||||
type: typeof KILL_ALL_RETRY_TASKS_ERROR;
|
||||
interface ArchiveAllRetryTasksErrorAction {
|
||||
type: typeof ARCHIVE_ALL_RETRY_TASKS_ERROR;
|
||||
queue: string;
|
||||
error: string;
|
||||
}
|
||||
@ -644,91 +656,91 @@ interface DeleteAllRetryTasksErrorAction {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface DeleteDeadTaskBeginAction {
|
||||
type: typeof DELETE_DEAD_TASK_BEGIN;
|
||||
interface DeleteArchivedTaskBeginAction {
|
||||
type: typeof DELETE_ARCHIVED_TASK_BEGIN;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
}
|
||||
|
||||
interface DeleteDeadTaskSuccessAction {
|
||||
type: typeof DELETE_DEAD_TASK_SUCCESS;
|
||||
interface DeleteArchivedTaskSuccessAction {
|
||||
type: typeof DELETE_ARCHIVED_TASK_SUCCESS;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
}
|
||||
|
||||
interface DeleteDeadTaskErrorAction {
|
||||
type: typeof DELETE_DEAD_TASK_ERROR;
|
||||
interface DeleteArchivedTaskErrorAction {
|
||||
type: typeof DELETE_ARCHIVED_TASK_ERROR;
|
||||
queue: string;
|
||||
taskKey: string;
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface BatchDeleteDeadTasksBeginAction {
|
||||
type: typeof BATCH_DELETE_DEAD_TASKS_BEGIN;
|
||||
interface BatchDeleteArchivedTasksBeginAction {
|
||||
type: typeof BATCH_DELETE_ARCHIVED_TASKS_BEGIN;
|
||||
queue: string;
|
||||
taskKeys: string[];
|
||||
}
|
||||
|
||||
interface BatchDeleteDeadTasksSuccessAction {
|
||||
type: typeof BATCH_DELETE_DEAD_TASKS_SUCCESS;
|
||||
interface BatchDeleteArchivedTasksSuccessAction {
|
||||
type: typeof BATCH_DELETE_ARCHIVED_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
payload: BatchDeleteTasksResponse;
|
||||
}
|
||||
|
||||
interface BatchDeleteDeadTasksErrorAction {
|
||||
type: typeof BATCH_DELETE_DEAD_TASKS_ERROR;
|
||||
interface BatchDeleteArchivedTasksErrorAction {
|
||||
type: typeof BATCH_DELETE_ARCHIVED_TASKS_ERROR;
|
||||
queue: string;
|
||||
taskKeys: string[];
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface BatchRunDeadTasksBeginAction {
|
||||
type: typeof BATCH_RUN_DEAD_TASKS_BEGIN;
|
||||
interface BatchRunArchivedTasksBeginAction {
|
||||
type: typeof BATCH_RUN_ARCHIVED_TASKS_BEGIN;
|
||||
queue: string;
|
||||
taskKeys: string[];
|
||||
}
|
||||
|
||||
interface BatchRunDeadTasksSuccessAction {
|
||||
type: typeof BATCH_RUN_DEAD_TASKS_SUCCESS;
|
||||
interface BatchRunArchivedTasksSuccessAction {
|
||||
type: typeof BATCH_RUN_ARCHIVED_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
payload: BatchRunTasksResponse;
|
||||
}
|
||||
|
||||
interface BatchRunDeadTasksErrorAction {
|
||||
type: typeof BATCH_RUN_DEAD_TASKS_ERROR;
|
||||
interface BatchRunArchivedTasksErrorAction {
|
||||
type: typeof BATCH_RUN_ARCHIVED_TASKS_ERROR;
|
||||
queue: string;
|
||||
taskKeys: string[];
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface RunAllDeadTasksBeginAction {
|
||||
type: typeof RUN_ALL_DEAD_TASKS_BEGIN;
|
||||
interface RunAllArchivedTasksBeginAction {
|
||||
type: typeof RUN_ALL_ARCHIVED_TASKS_BEGIN;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface RunAllDeadTasksSuccessAction {
|
||||
type: typeof RUN_ALL_DEAD_TASKS_SUCCESS;
|
||||
interface RunAllArchivedTasksSuccessAction {
|
||||
type: typeof RUN_ALL_ARCHIVED_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface RunAllDeadTasksErrorAction {
|
||||
type: typeof RUN_ALL_DEAD_TASKS_ERROR;
|
||||
interface RunAllArchivedTasksErrorAction {
|
||||
type: typeof RUN_ALL_ARCHIVED_TASKS_ERROR;
|
||||
queue: string;
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface DeleteAllDeadTasksBeginAction {
|
||||
type: typeof DELETE_ALL_DEAD_TASKS_BEGIN;
|
||||
interface DeleteAllArchivedTasksBeginAction {
|
||||
type: typeof DELETE_ALL_ARCHIVED_TASKS_BEGIN;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface DeleteAllDeadTasksSuccessAction {
|
||||
type: typeof DELETE_ALL_DEAD_TASKS_SUCCESS;
|
||||
interface DeleteAllArchivedTasksSuccessAction {
|
||||
type: typeof DELETE_ALL_ARCHIVED_TASKS_SUCCESS;
|
||||
queue: string;
|
||||
}
|
||||
|
||||
interface DeleteAllDeadTasksErrorAction {
|
||||
type: typeof DELETE_ALL_DEAD_TASKS_ERROR;
|
||||
interface DeleteAllArchivedTasksErrorAction {
|
||||
type: typeof DELETE_ALL_ARCHIVED_TASKS_ERROR;
|
||||
queue: string;
|
||||
error: string;
|
||||
}
|
||||
@ -747,9 +759,9 @@ export type TasksActionTypes =
|
||||
| ListRetryTasksBeginAction
|
||||
| ListRetryTasksSuccessAction
|
||||
| ListRetryTasksErrorAction
|
||||
| ListDeadTasksBeginAction
|
||||
| ListDeadTasksSuccessAction
|
||||
| ListDeadTasksErrorAction
|
||||
| ListArchivedTasksBeginAction
|
||||
| ListArchivedTasksSuccessAction
|
||||
| ListArchivedTasksErrorAction
|
||||
| CancelActiveTaskBeginAction
|
||||
| CancelActiveTaskSuccessAction
|
||||
| CancelActiveTaskErrorAction
|
||||
@ -765,15 +777,15 @@ export type TasksActionTypes =
|
||||
| RunRetryTaskBeginAction
|
||||
| RunRetryTaskSuccessAction
|
||||
| RunRetryTaskErrorAction
|
||||
| RunDeadTaskBeginAction
|
||||
| RunDeadTaskSuccessAction
|
||||
| RunDeadTaskErrorAction
|
||||
| KillScheduledTaskBeginAction
|
||||
| KillScheduledTaskSuccessAction
|
||||
| KillScheduledTaskErrorAction
|
||||
| KillRetryTaskBeginAction
|
||||
| KillRetryTaskSuccessAction
|
||||
| KillRetryTaskErrorAction
|
||||
| RunArchivedTaskBeginAction
|
||||
| RunArchivedTaskSuccessAction
|
||||
| RunArchivedTaskErrorAction
|
||||
| ArchiveScheduledTaskBeginAction
|
||||
| ArchiveScheduledTaskSuccessAction
|
||||
| ArchiveScheduledTaskErrorAction
|
||||
| ArchiveRetryTaskBeginAction
|
||||
| ArchiveRetryTaskSuccessAction
|
||||
| ArchiveRetryTaskErrorAction
|
||||
| DeleteScheduledTaskBeginAction
|
||||
| DeleteScheduledTaskSuccessAction
|
||||
| DeleteScheduledTaskErrorAction
|
||||
@ -786,12 +798,12 @@ export type TasksActionTypes =
|
||||
| RunAllScheduledTasksBeginAction
|
||||
| RunAllScheduledTasksSuccessAction
|
||||
| RunAllScheduledTasksErrorAction
|
||||
| BatchKillScheduledTasksBeginAction
|
||||
| BatchKillScheduledTasksSuccessAction
|
||||
| BatchKillScheduledTasksErrorAction
|
||||
| KillAllScheduledTasksBeginAction
|
||||
| KillAllScheduledTasksSuccessAction
|
||||
| KillAllScheduledTasksErrorAction
|
||||
| BatchArchiveScheduledTasksBeginAction
|
||||
| BatchArchiveScheduledTasksSuccessAction
|
||||
| BatchArchiveScheduledTasksErrorAction
|
||||
| ArchiveAllScheduledTasksBeginAction
|
||||
| ArchiveAllScheduledTasksSuccessAction
|
||||
| ArchiveAllScheduledTasksErrorAction
|
||||
| DeleteAllScheduledTasksBeginAction
|
||||
| DeleteAllScheduledTasksSuccessAction
|
||||
| DeleteAllScheduledTasksErrorAction
|
||||
@ -807,30 +819,30 @@ export type TasksActionTypes =
|
||||
| RunAllRetryTasksBeginAction
|
||||
| RunAllRetryTasksSuccessAction
|
||||
| RunAllRetryTasksErrorAction
|
||||
| BatchKillRetryTasksBeginAction
|
||||
| BatchKillRetryTasksSuccessAction
|
||||
| BatchKillRetryTasksErrorAction
|
||||
| KillAllRetryTasksBeginAction
|
||||
| KillAllRetryTasksSuccessAction
|
||||
| KillAllRetryTasksErrorAction
|
||||
| BatchArchiveRetryTasksBeginAction
|
||||
| BatchArchiveRetryTasksSuccessAction
|
||||
| BatchArchiveRetryTasksErrorAction
|
||||
| ArchiveAllRetryTasksBeginAction
|
||||
| ArchiveAllRetryTasksSuccessAction
|
||||
| ArchiveAllRetryTasksErrorAction
|
||||
| DeleteAllRetryTasksBeginAction
|
||||
| DeleteAllRetryTasksSuccessAction
|
||||
| DeleteAllRetryTasksErrorAction
|
||||
| DeleteDeadTaskBeginAction
|
||||
| DeleteDeadTaskSuccessAction
|
||||
| DeleteDeadTaskErrorAction
|
||||
| BatchDeleteDeadTasksBeginAction
|
||||
| BatchDeleteDeadTasksSuccessAction
|
||||
| BatchDeleteDeadTasksErrorAction
|
||||
| BatchRunDeadTasksBeginAction
|
||||
| BatchRunDeadTasksSuccessAction
|
||||
| BatchRunDeadTasksErrorAction
|
||||
| RunAllDeadTasksBeginAction
|
||||
| RunAllDeadTasksSuccessAction
|
||||
| RunAllDeadTasksErrorAction
|
||||
| DeleteAllDeadTasksBeginAction
|
||||
| DeleteAllDeadTasksSuccessAction
|
||||
| DeleteAllDeadTasksErrorAction;
|
||||
| DeleteArchivedTaskBeginAction
|
||||
| DeleteArchivedTaskSuccessAction
|
||||
| DeleteArchivedTaskErrorAction
|
||||
| BatchDeleteArchivedTasksBeginAction
|
||||
| BatchDeleteArchivedTasksSuccessAction
|
||||
| BatchDeleteArchivedTasksErrorAction
|
||||
| BatchRunArchivedTasksBeginAction
|
||||
| BatchRunArchivedTasksSuccessAction
|
||||
| BatchRunArchivedTasksErrorAction
|
||||
| RunAllArchivedTasksBeginAction
|
||||
| RunAllArchivedTasksSuccessAction
|
||||
| RunAllArchivedTasksErrorAction
|
||||
| DeleteAllArchivedTasksBeginAction
|
||||
| DeleteAllArchivedTasksSuccessAction
|
||||
| DeleteAllArchivedTasksErrorAction;
|
||||
|
||||
export function listActiveTasksAsync(
|
||||
qname: string,
|
||||
@ -924,24 +936,24 @@ export function listRetryTasksAsync(
|
||||
};
|
||||
}
|
||||
|
||||
export function listDeadTasksAsync(
|
||||
export function listArchivedTasksAsync(
|
||||
qname: string,
|
||||
pageOpts?: PaginationOptions
|
||||
) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: LIST_DEAD_TASKS_BEGIN, queue: qname });
|
||||
dispatch({ type: LIST_ARCHIVED_TASKS_BEGIN, queue: qname });
|
||||
try {
|
||||
const response = await listDeadTasks(qname, pageOpts);
|
||||
const response = await listArchivedTasks(qname, pageOpts);
|
||||
dispatch({
|
||||
type: LIST_DEAD_TASKS_SUCCESS,
|
||||
type: LIST_ARCHIVED_TASKS_SUCCESS,
|
||||
queue: qname,
|
||||
payload: response,
|
||||
});
|
||||
} catch {
|
||||
dispatch({
|
||||
type: LIST_DEAD_TASKS_ERROR,
|
||||
type: LIST_ARCHIVED_TASKS_ERROR,
|
||||
queue: qname,
|
||||
error: `Could not retreive dead tasks data for queue: ${qname}`,
|
||||
error: `Could not retreive archived tasks data for queue: ${qname}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -1039,17 +1051,17 @@ export function runRetryTaskAsync(queue: string, taskKey: string) {
|
||||
};
|
||||
}
|
||||
|
||||
export function killScheduledTaskAsync(queue: string, taskKey: string) {
|
||||
export function archiveScheduledTaskAsync(queue: string, taskKey: string) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: KILL_SCHEDULED_TASK_BEGIN, queue, taskKey });
|
||||
dispatch({ type: ARCHIVE_SCHEDULED_TASK_BEGIN, queue, taskKey });
|
||||
try {
|
||||
await killScheduledTask(queue, taskKey);
|
||||
dispatch({ type: KILL_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
||||
await archiveScheduledTask(queue, taskKey);
|
||||
dispatch({ type: ARCHIVE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
|
||||
} catch (error) {
|
||||
console.error("killScheduledTaskAsync: ", error);
|
||||
console.error("archiveScheduledTaskAsync: ", error);
|
||||
dispatch({
|
||||
type: KILL_SCHEDULED_TASK_ERROR,
|
||||
error: `Could not kill task: ${taskKey}`,
|
||||
type: ARCHIVE_SCHEDULED_TASK_ERROR,
|
||||
error: `Could not archive task: ${taskKey}`,
|
||||
queue,
|
||||
taskKey,
|
||||
});
|
||||
@ -1057,17 +1069,17 @@ export function killScheduledTaskAsync(queue: string, taskKey: string) {
|
||||
};
|
||||
}
|
||||
|
||||
export function killRetryTaskAsync(queue: string, taskKey: string) {
|
||||
export function archiveRetryTaskAsync(queue: string, taskKey: string) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: KILL_RETRY_TASK_BEGIN, queue, taskKey });
|
||||
dispatch({ type: ARCHIVE_RETRY_TASK_BEGIN, queue, taskKey });
|
||||
try {
|
||||
await killRetryTask(queue, taskKey);
|
||||
dispatch({ type: KILL_RETRY_TASK_SUCCESS, queue, taskKey });
|
||||
await archiveRetryTask(queue, taskKey);
|
||||
dispatch({ type: ARCHIVE_RETRY_TASK_SUCCESS, queue, taskKey });
|
||||
} catch (error) {
|
||||
console.error("killRetryTaskAsync: ", error);
|
||||
console.error("archiveRetryTaskAsync: ", error);
|
||||
dispatch({
|
||||
type: KILL_RETRY_TASK_ERROR,
|
||||
error: `Could not kill task: ${taskKey}`,
|
||||
type: ARCHIVE_RETRY_TASK_ERROR,
|
||||
error: `Could not archive task: ${taskKey}`,
|
||||
queue,
|
||||
taskKey,
|
||||
});
|
||||
@ -1075,16 +1087,16 @@ export function killRetryTaskAsync(queue: string, taskKey: string) {
|
||||
};
|
||||
}
|
||||
|
||||
export function runDeadTaskAsync(queue: string, taskKey: string) {
|
||||
export function runArchivedTaskAsync(queue: string, taskKey: string) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: RUN_DEAD_TASK_BEGIN, queue, taskKey });
|
||||
dispatch({ type: RUN_ARCHIVED_TASK_BEGIN, queue, taskKey });
|
||||
try {
|
||||
await runDeadTask(queue, taskKey);
|
||||
dispatch({ type: RUN_DEAD_TASK_SUCCESS, queue, taskKey });
|
||||
await runArchivedTask(queue, taskKey);
|
||||
dispatch({ type: RUN_ARCHIVED_TASK_SUCCESS, queue, taskKey });
|
||||
} catch (error) {
|
||||
console.error("runDeadTaskAsync: ", error);
|
||||
console.error("runArchivedTaskAsync: ", error);
|
||||
dispatch({
|
||||
type: RUN_DEAD_TASK_ERROR,
|
||||
type: RUN_ARCHIVED_TASK_ERROR,
|
||||
error: `Could not run task: ${taskKey}`,
|
||||
queue,
|
||||
taskKey,
|
||||
@ -1158,24 +1170,24 @@ export function batchRunScheduledTasksAsync(queue: string, taskKeys: string[]) {
|
||||
};
|
||||
}
|
||||
|
||||
export function batchKillScheduledTasksAsync(
|
||||
export function batchArchiveScheduledTasksAsync(
|
||||
queue: string,
|
||||
taskKeys: string[]
|
||||
) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: BATCH_KILL_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
|
||||
dispatch({ type: BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
|
||||
try {
|
||||
const response = await batchKillScheduledTasks(queue, taskKeys);
|
||||
const response = await batchArchiveScheduledTasks(queue, taskKeys);
|
||||
dispatch({
|
||||
type: BATCH_KILL_SCHEDULED_TASKS_SUCCESS,
|
||||
type: BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
|
||||
queue: queue,
|
||||
payload: response,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("batchKillScheduledTasksAsync: ", error);
|
||||
console.error("batchArchiveScheduledTasksAsync: ", error);
|
||||
dispatch({
|
||||
type: BATCH_KILL_SCHEDULED_TASKS_ERROR,
|
||||
error: `Could not batch kill tasks: ${taskKeys}`,
|
||||
type: BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR,
|
||||
error: `Could not batch archive tasks: ${taskKeys}`,
|
||||
queue,
|
||||
taskKeys,
|
||||
});
|
||||
@ -1217,17 +1229,17 @@ export function runAllScheduledTasksAsync(queue: string) {
|
||||
};
|
||||
}
|
||||
|
||||
export function killAllScheduledTasksAsync(queue: string) {
|
||||
export function archiveAllScheduledTasksAsync(queue: string) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_BEGIN, queue });
|
||||
try {
|
||||
await killAllScheduledTasks(queue);
|
||||
await archiveAllScheduledTasks(queue);
|
||||
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_SUCCESS, queue });
|
||||
} catch (error) {
|
||||
console.error("killAllScheduledTasksAsync: ", error);
|
||||
console.error("archiveAllScheduledTasksAsync: ", error);
|
||||
dispatch({
|
||||
type: RUN_ALL_SCHEDULED_TASKS_ERROR,
|
||||
error: `Could not kill all scheduled tasks`,
|
||||
error: `Could not archive all scheduled tasks`,
|
||||
queue,
|
||||
});
|
||||
}
|
||||
@ -1296,21 +1308,21 @@ export function batchRunRetryTasksAsync(queue: string, taskKeys: string[]) {
|
||||
};
|
||||
}
|
||||
|
||||
export function batchKillRetryTasksAsync(queue: string, taskKeys: string[]) {
|
||||
export function batchArchiveRetryTasksAsync(queue: string, taskKeys: string[]) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: BATCH_KILL_RETRY_TASKS_BEGIN, queue, taskKeys });
|
||||
dispatch({ type: BATCH_ARCHIVE_RETRY_TASKS_BEGIN, queue, taskKeys });
|
||||
try {
|
||||
const response = await batchKillRetryTasks(queue, taskKeys);
|
||||
const response = await batchArchiveRetryTasks(queue, taskKeys);
|
||||
dispatch({
|
||||
type: BATCH_KILL_RETRY_TASKS_SUCCESS,
|
||||
type: BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
|
||||
queue: queue,
|
||||
payload: response,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("batchKillRetryTasksAsync: ", error);
|
||||
console.error("batchArchiveRetryTasksAsync: ", error);
|
||||
dispatch({
|
||||
type: BATCH_KILL_RETRY_TASKS_ERROR,
|
||||
error: `Could not batch kill tasks: ${taskKeys}`,
|
||||
type: BATCH_ARCHIVE_RETRY_TASKS_ERROR,
|
||||
error: `Could not batch archive tasks: ${taskKeys}`,
|
||||
queue,
|
||||
taskKeys,
|
||||
});
|
||||
@ -1352,33 +1364,33 @@ export function runAllRetryTasksAsync(queue: string) {
|
||||
};
|
||||
}
|
||||
|
||||
export function killAllRetryTasksAsync(queue: string) {
|
||||
export function archiveAllRetryTasksAsync(queue: string) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: KILL_ALL_RETRY_TASKS_BEGIN, queue });
|
||||
dispatch({ type: ARCHIVE_ALL_RETRY_TASKS_BEGIN, queue });
|
||||
try {
|
||||
await killAllRetryTasks(queue);
|
||||
dispatch({ type: KILL_ALL_RETRY_TASKS_SUCCESS, queue });
|
||||
await archiveAllRetryTasks(queue);
|
||||
dispatch({ type: ARCHIVE_ALL_RETRY_TASKS_SUCCESS, queue });
|
||||
} catch (error) {
|
||||
console.error("killAllRetryTasksAsync: ", error);
|
||||
console.error("archiveAllRetryTasksAsync: ", error);
|
||||
dispatch({
|
||||
type: KILL_ALL_RETRY_TASKS_ERROR,
|
||||
error: `Could not kill all retry tasks`,
|
||||
type: ARCHIVE_ALL_RETRY_TASKS_ERROR,
|
||||
error: `Could not archive all retry tasks`,
|
||||
queue,
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function deleteDeadTaskAsync(queue: string, taskKey: string) {
|
||||
export function deleteArchivedTaskAsync(queue: string, taskKey: string) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: DELETE_DEAD_TASK_BEGIN, queue, taskKey });
|
||||
dispatch({ type: DELETE_ARCHIVED_TASK_BEGIN, queue, taskKey });
|
||||
try {
|
||||
await deleteDeadTask(queue, taskKey);
|
||||
dispatch({ type: DELETE_DEAD_TASK_SUCCESS, queue, taskKey });
|
||||
await deleteArchivedTask(queue, taskKey);
|
||||
dispatch({ type: DELETE_ARCHIVED_TASK_SUCCESS, queue, taskKey });
|
||||
} catch (error) {
|
||||
console.error("deleteDeadTaskAsync: ", error);
|
||||
console.error("deleteArchivedTaskAsync: ", error);
|
||||
dispatch({
|
||||
type: DELETE_DEAD_TASK_ERROR,
|
||||
type: DELETE_ARCHIVED_TASK_ERROR,
|
||||
error: `Could not delete task: ${taskKey}`,
|
||||
queue,
|
||||
taskKey,
|
||||
@ -1387,20 +1399,23 @@ export function deleteDeadTaskAsync(queue: string, taskKey: string) {
|
||||
};
|
||||
}
|
||||
|
||||
export function batchDeleteDeadTasksAsync(queue: string, taskKeys: string[]) {
|
||||
export function batchDeleteArchivedTasksAsync(
|
||||
queue: string,
|
||||
taskKeys: string[]
|
||||
) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: BATCH_DELETE_DEAD_TASKS_BEGIN, queue, taskKeys });
|
||||
dispatch({ type: BATCH_DELETE_ARCHIVED_TASKS_BEGIN, queue, taskKeys });
|
||||
try {
|
||||
const response = await batchDeleteDeadTasks(queue, taskKeys);
|
||||
const response = await batchDeleteArchivedTasks(queue, taskKeys);
|
||||
dispatch({
|
||||
type: BATCH_DELETE_DEAD_TASKS_SUCCESS,
|
||||
type: BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
|
||||
queue: queue,
|
||||
payload: response,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("batchDeleteDeadTasksAsync: ", error);
|
||||
console.error("batchDeleteArchivedTasksAsync: ", error);
|
||||
dispatch({
|
||||
type: BATCH_DELETE_DEAD_TASKS_ERROR,
|
||||
type: BATCH_DELETE_ARCHIVED_TASKS_ERROR,
|
||||
error: `Could not batch delete tasks: ${taskKeys}`,
|
||||
queue,
|
||||
taskKeys,
|
||||
@ -1409,20 +1424,20 @@ export function batchDeleteDeadTasksAsync(queue: string, taskKeys: string[]) {
|
||||
};
|
||||
}
|
||||
|
||||
export function batchRunDeadTasksAsync(queue: string, taskKeys: string[]) {
|
||||
export function batchRunArchivedTasksAsync(queue: string, taskKeys: string[]) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: BATCH_RUN_DEAD_TASKS_BEGIN, queue, taskKeys });
|
||||
dispatch({ type: BATCH_RUN_ARCHIVED_TASKS_BEGIN, queue, taskKeys });
|
||||
try {
|
||||
const response = await batchRunDeadTasks(queue, taskKeys);
|
||||
const response = await batchRunArchivedTasks(queue, taskKeys);
|
||||
dispatch({
|
||||
type: BATCH_RUN_DEAD_TASKS_SUCCESS,
|
||||
type: BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
|
||||
queue: queue,
|
||||
payload: response,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("batchRunDeadTasksAsync: ", error);
|
||||
console.error("batchRunArchivedTasksAsync: ", error);
|
||||
dispatch({
|
||||
type: BATCH_RUN_DEAD_TASKS_ERROR,
|
||||
type: BATCH_RUN_ARCHIVED_TASKS_ERROR,
|
||||
error: `Could not batch run tasks: ${taskKeys}`,
|
||||
queue,
|
||||
taskKeys,
|
||||
@ -1431,34 +1446,34 @@ export function batchRunDeadTasksAsync(queue: string, taskKeys: string[]) {
|
||||
};
|
||||
}
|
||||
|
||||
export function deleteAllDeadTasksAsync(queue: string) {
|
||||
export function deleteAllArchivedTasksAsync(queue: string) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: DELETE_ALL_DEAD_TASKS_BEGIN, queue });
|
||||
dispatch({ type: DELETE_ALL_ARCHIVED_TASKS_BEGIN, queue });
|
||||
try {
|
||||
await deleteAllDeadTasks(queue);
|
||||
dispatch({ type: DELETE_ALL_DEAD_TASKS_SUCCESS, queue });
|
||||
await deleteAllArchivedTasks(queue);
|
||||
dispatch({ type: DELETE_ALL_ARCHIVED_TASKS_SUCCESS, queue });
|
||||
} catch (error) {
|
||||
console.error("deleteAllDeadTasksAsync: ", error);
|
||||
console.error("deleteAllArchivedTasksAsync: ", error);
|
||||
dispatch({
|
||||
type: DELETE_ALL_DEAD_TASKS_ERROR,
|
||||
error: `Could not delete all dead tasks`,
|
||||
type: DELETE_ALL_ARCHIVED_TASKS_ERROR,
|
||||
error: `Could not delete all archived tasks`,
|
||||
queue,
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function runAllDeadTasksAsync(queue: string) {
|
||||
export function runAllArchivedTasksAsync(queue: string) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: RUN_ALL_DEAD_TASKS_BEGIN, queue });
|
||||
dispatch({ type: RUN_ALL_ARCHIVED_TASKS_BEGIN, queue });
|
||||
try {
|
||||
await runAllDeadTasks(queue);
|
||||
dispatch({ type: RUN_ALL_DEAD_TASKS_SUCCESS, queue });
|
||||
await runAllArchivedTasks(queue);
|
||||
dispatch({ type: RUN_ALL_ARCHIVED_TASKS_SUCCESS, queue });
|
||||
} catch (error) {
|
||||
console.error("runAllDeadTasksAsync: ", error);
|
||||
console.error("runAllArchivedTasksAsync: ", error);
|
||||
dispatch({
|
||||
type: RUN_ALL_DEAD_TASKS_ERROR,
|
||||
error: `Could not run all dead tasks`,
|
||||
type: RUN_ALL_ARCHIVED_TASKS_ERROR,
|
||||
error: `Could not run all archived tasks`,
|
||||
queue,
|
||||
});
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export interface ListRetryTasksResponse {
|
||||
stats: Queue;
|
||||
}
|
||||
|
||||
export interface ListDeadTasksResponse {
|
||||
tasks: DeadTask[];
|
||||
export interface ListArchivedTasksResponse {
|
||||
tasks: ArchivedTask[];
|
||||
stats: Queue;
|
||||
}
|
||||
|
||||
@ -63,8 +63,8 @@ export interface BatchRunTasksResponse {
|
||||
error_keys: string[];
|
||||
}
|
||||
|
||||
export interface BatchKillTasksResponse {
|
||||
dead_keys: string[];
|
||||
export interface BatchArchiveTasksResponse {
|
||||
archived_keys: string[];
|
||||
error_keys: string[];
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ export interface Queue {
|
||||
pending: number;
|
||||
scheduled: number;
|
||||
retry: number;
|
||||
dead: number;
|
||||
archived: number;
|
||||
processed: number;
|
||||
failed: number;
|
||||
timestamp: string;
|
||||
@ -267,7 +267,7 @@ export interface RetryTask extends BaseTask {
|
||||
error_message: string;
|
||||
}
|
||||
|
||||
export interface DeadTask extends BaseTask {
|
||||
export interface ArchivedTask extends BaseTask {
|
||||
id: string;
|
||||
key: string;
|
||||
queue: string;
|
||||
@ -444,11 +444,11 @@ export async function listRetryTasks(
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function listDeadTasks(
|
||||
export async function listArchivedTasks(
|
||||
qname: string,
|
||||
pageOpts?: PaginationOptions
|
||||
): Promise<ListDeadTasksResponse> {
|
||||
let url = `${BASE_URL}/queues/${qname}/dead_tasks`;
|
||||
): Promise<ListArchivedTasksResponse> {
|
||||
let url = `${BASE_URL}/queues/${qname}/archived_tasks`;
|
||||
if (pageOpts) {
|
||||
url += `?${queryString.stringify(pageOpts)}`;
|
||||
}
|
||||
@ -469,13 +469,13 @@ export async function runScheduledTask(
|
||||
});
|
||||
}
|
||||
|
||||
export async function killScheduledTask(
|
||||
export async function archiveScheduledTask(
|
||||
qname: string,
|
||||
taskKey: string
|
||||
): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks/${taskKey}:kill`,
|
||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks/${taskKey}:archive`,
|
||||
});
|
||||
}
|
||||
|
||||
@ -531,13 +531,13 @@ export async function runAllScheduledTasks(qname: string): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function batchKillScheduledTasks(
|
||||
export async function batchArchiveScheduledTasks(
|
||||
qname: string,
|
||||
taskKeys: string[]
|
||||
): Promise<BatchKillTasksResponse> {
|
||||
): Promise<BatchArchiveTasksResponse> {
|
||||
const resp = await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_kill`,
|
||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_archive`,
|
||||
data: {
|
||||
task_keys: taskKeys,
|
||||
},
|
||||
@ -545,10 +545,10 @@ export async function batchKillScheduledTasks(
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function killAllScheduledTasks(qname: string): Promise<void> {
|
||||
export async function archiveAllScheduledTasks(qname: string): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:kill_all`,
|
||||
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:archive_all`,
|
||||
});
|
||||
}
|
||||
|
||||
@ -562,13 +562,13 @@ export async function runRetryTask(
|
||||
});
|
||||
}
|
||||
|
||||
export async function killRetryTask(
|
||||
export async function archiveRetryTask(
|
||||
qname: string,
|
||||
taskKey: string
|
||||
): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/retry_tasks/${taskKey}:kill`,
|
||||
url: `${BASE_URL}/queues/${qname}/retry_tasks/${taskKey}:archive`,
|
||||
});
|
||||
}
|
||||
|
||||
@ -624,13 +624,13 @@ export async function runAllRetryTasks(qname: string): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function batchKillRetryTasks(
|
||||
export async function batchArchiveRetryTasks(
|
||||
qname: string,
|
||||
taskKeys: string[]
|
||||
): Promise<BatchKillTasksResponse> {
|
||||
): Promise<BatchArchiveTasksResponse> {
|
||||
const resp = await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_kill`,
|
||||
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_archive`,
|
||||
data: {
|
||||
task_keys: taskKeys,
|
||||
},
|
||||
@ -638,40 +638,40 @@ export async function batchKillRetryTasks(
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function killAllRetryTasks(qname: string): Promise<void> {
|
||||
export async function archiveAllRetryTasks(qname: string): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/retry_tasks:kill_all`,
|
||||
url: `${BASE_URL}/queues/${qname}/retry_tasks:archive_all`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function runDeadTask(
|
||||
export async function runArchivedTask(
|
||||
qname: string,
|
||||
taskKey: string
|
||||
): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/dead_tasks/${taskKey}:run`,
|
||||
url: `${BASE_URL}/queues/${qname}/archived_tasks/${taskKey}:run`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteDeadTask(
|
||||
export async function deleteArchivedTask(
|
||||
qname: string,
|
||||
taskKey: string
|
||||
): Promise<void> {
|
||||
await axios({
|
||||
method: "delete",
|
||||
url: `${BASE_URL}/queues/${qname}/dead_tasks/${taskKey}`,
|
||||
url: `${BASE_URL}/queues/${qname}/archived_tasks/${taskKey}`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function batchDeleteDeadTasks(
|
||||
export async function batchDeleteArchivedTasks(
|
||||
qname: string,
|
||||
taskKeys: string[]
|
||||
): Promise<BatchDeleteTasksResponse> {
|
||||
const resp = await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/dead_tasks:batch_delete`,
|
||||
url: `${BASE_URL}/queues/${qname}/archived_tasks:batch_delete`,
|
||||
data: {
|
||||
task_keys: taskKeys,
|
||||
},
|
||||
@ -679,20 +679,20 @@ export async function batchDeleteDeadTasks(
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function deleteAllDeadTasks(qname: string): Promise<void> {
|
||||
export async function deleteAllArchivedTasks(qname: string): Promise<void> {
|
||||
await axios({
|
||||
method: "delete",
|
||||
url: `${BASE_URL}/queues/${qname}/dead_tasks:delete_all`,
|
||||
url: `${BASE_URL}/queues/${qname}/archived_tasks:delete_all`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function batchRunDeadTasks(
|
||||
export async function batchRunArchivedTasks(
|
||||
qname: string,
|
||||
taskKeys: string[]
|
||||
): Promise<BatchRunTasksResponse> {
|
||||
const resp = await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/dead_tasks:batch_run`,
|
||||
url: `${BASE_URL}/queues/${qname}/archived_tasks:batch_run`,
|
||||
data: {
|
||||
task_keys: taskKeys,
|
||||
},
|
||||
@ -700,10 +700,10 @@ export async function batchRunDeadTasks(
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function runAllDeadTasks(qname: string): Promise<void> {
|
||||
export async function runAllArchivedTasks(qname: string): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/dead_tasks:run_all`,
|
||||
url: `${BASE_URL}/queues/${qname}/archived_tasks:run_all`,
|
||||
});
|
||||
}
|
||||
|
||||
|
389
ui/src/components/ArchivedTasksTable.tsx
Normal file
389
ui/src/components/ArchivedTasksTable.tsx
Normal file
@ -0,0 +1,389 @@
|
||||
import React, { useCallback, useState } from "react";
|
||||
import clsx from "clsx";
|
||||
import { connect, ConnectedProps } from "react-redux";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import Table from "@material-ui/core/Table";
|
||||
import TableBody from "@material-ui/core/TableBody";
|
||||
import TableCell from "@material-ui/core/TableCell";
|
||||
import Checkbox from "@material-ui/core/Checkbox";
|
||||
import TableContainer from "@material-ui/core/TableContainer";
|
||||
import TableHead from "@material-ui/core/TableHead";
|
||||
import TableRow from "@material-ui/core/TableRow";
|
||||
import Tooltip from "@material-ui/core/Tooltip";
|
||||
import Paper from "@material-ui/core/Paper";
|
||||
import Box from "@material-ui/core/Box";
|
||||
import Collapse from "@material-ui/core/Collapse";
|
||||
import IconButton from "@material-ui/core/IconButton";
|
||||
import PlayArrowIcon from "@material-ui/icons/PlayArrow";
|
||||
import DeleteIcon from "@material-ui/icons/Delete";
|
||||
import MoreHorizIcon from "@material-ui/icons/MoreHoriz";
|
||||
import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp";
|
||||
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown";
|
||||
import Typography from "@material-ui/core/Typography";
|
||||
import TableFooter from "@material-ui/core/TableFooter";
|
||||
import TablePagination from "@material-ui/core/TablePagination";
|
||||
import Alert from "@material-ui/lab/Alert";
|
||||
import AlertTitle from "@material-ui/lab/AlertTitle";
|
||||
import SyntaxHighlighter from "react-syntax-highlighter";
|
||||
import syntaxHighlightStyle from "react-syntax-highlighter/dist/esm/styles/hljs/github";
|
||||
import { AppState } from "../store";
|
||||
import {
|
||||
batchDeleteArchivedTasksAsync,
|
||||
batchRunArchivedTasksAsync,
|
||||
deleteArchivedTaskAsync,
|
||||
deleteAllArchivedTasksAsync,
|
||||
listArchivedTasksAsync,
|
||||
runArchivedTaskAsync,
|
||||
runAllArchivedTasksAsync,
|
||||
} from "../actions/tasksActions";
|
||||
import TablePaginationActions, {
|
||||
defaultPageSize,
|
||||
rowsPerPageOptions,
|
||||
} from "./TablePaginationActions";
|
||||
import TableActions from "./TableActions";
|
||||
import { timeAgo, uuidPrefix } from "../utils";
|
||||
import { usePolling } from "../hooks";
|
||||
import { ArchivedTaskExtended } from "../reducers/tasksReducer";
|
||||
import { TableColumn } from "../types/table";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
table: {
|
||||
minWidth: 650,
|
||||
},
|
||||
});
|
||||
|
||||
const useRowStyles = makeStyles({
|
||||
root: {
|
||||
"& > *": {
|
||||
borderBottom: "unset",
|
||||
},
|
||||
},
|
||||
actionCell: {
|
||||
width: "96px",
|
||||
},
|
||||
activeActionCell: {
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
},
|
||||
});
|
||||
|
||||
function mapStateToProps(state: AppState) {
|
||||
return {
|
||||
loading: state.tasks.archivedTasks.loading,
|
||||
tasks: state.tasks.archivedTasks.data,
|
||||
batchActionPending: state.tasks.archivedTasks.batchActionPending,
|
||||
allActionPending: state.tasks.archivedTasks.allActionPending,
|
||||
pollInterval: state.settings.pollInterval,
|
||||
};
|
||||
}
|
||||
|
||||
const mapDispatchToProps = {
|
||||
listArchivedTasksAsync,
|
||||
runArchivedTaskAsync,
|
||||
runAllArchivedTasksAsync,
|
||||
deleteArchivedTaskAsync,
|
||||
deleteAllArchivedTasksAsync,
|
||||
batchRunArchivedTasksAsync,
|
||||
batchDeleteArchivedTasksAsync,
|
||||
};
|
||||
|
||||
const connector = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
type ReduxProps = ConnectedProps<typeof connector>;
|
||||
|
||||
interface Props {
|
||||
queue: string; // name of the queue.
|
||||
totalTaskCount: number; // totoal number of archived tasks.
|
||||
}
|
||||
|
||||
function ArchivedTasksTable(props: Props & ReduxProps) {
|
||||
const { pollInterval, listArchivedTasksAsync, queue } = props;
|
||||
const classes = useStyles();
|
||||
const [page, setPage] = useState(0);
|
||||
const [pageSize, setPageSize] = useState(defaultPageSize);
|
||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
||||
const [activeTaskId, setActiveTaskId] = useState<string>("");
|
||||
|
||||
const handleChangePage = (
|
||||
event: React.MouseEvent<HTMLButtonElement> | null,
|
||||
newPage: number
|
||||
) => {
|
||||
setPage(newPage);
|
||||
};
|
||||
|
||||
const handleChangeRowsPerPage = (
|
||||
event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
|
||||
) => {
|
||||
setPageSize(parseInt(event.target.value, 10));
|
||||
setPage(0);
|
||||
};
|
||||
|
||||
const handleSelectAllClick = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (event.target.checked) {
|
||||
const newSelected = props.tasks.map((t) => t.key);
|
||||
setSelectedKeys(newSelected);
|
||||
} else {
|
||||
setSelectedKeys([]);
|
||||
}
|
||||
};
|
||||
|
||||
const handleRunAllClick = () => {
|
||||
props.runAllArchivedTasksAsync(queue);
|
||||
};
|
||||
|
||||
const handleDeleteAllClick = () => {
|
||||
props.deleteAllArchivedTasksAsync(queue);
|
||||
};
|
||||
|
||||
const handleBatchRunClick = () => {
|
||||
props
|
||||
.batchRunArchivedTasksAsync(queue, selectedKeys)
|
||||
.then(() => setSelectedKeys([]));
|
||||
};
|
||||
|
||||
const handleBatchDeleteClick = () => {
|
||||
props
|
||||
.batchDeleteArchivedTasksAsync(queue, selectedKeys)
|
||||
.then(() => setSelectedKeys([]));
|
||||
};
|
||||
|
||||
const fetchData = useCallback(() => {
|
||||
const pageOpts = { page: page + 1, size: pageSize };
|
||||
listArchivedTasksAsync(queue, pageOpts);
|
||||
}, [page, pageSize, queue, listArchivedTasksAsync]);
|
||||
|
||||
usePolling(fetchData, pollInterval);
|
||||
|
||||
if (props.tasks.length === 0) {
|
||||
return (
|
||||
<Alert severity="info">
|
||||
<AlertTitle>Info</AlertTitle>
|
||||
No archived tasks at this time.
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
||||
const columns: TableColumn[] = [
|
||||
{ key: "icon", label: "", align: "left" },
|
||||
{ key: "id", label: "ID", align: "left" },
|
||||
{ key: "type", label: "Type", align: "left" },
|
||||
{ key: "last_failed", label: "Last Failed", align: "left" },
|
||||
{ key: "last_error", label: "Last Error", align: "left" },
|
||||
{ key: "actions", label: "Actions", align: "center" },
|
||||
];
|
||||
|
||||
const rowCount = props.tasks.length;
|
||||
const numSelected = selectedKeys.length;
|
||||
return (
|
||||
<div>
|
||||
<TableActions
|
||||
showIconButtons={numSelected > 0}
|
||||
iconButtonActions={[
|
||||
{
|
||||
tooltip: "Delete",
|
||||
icon: <DeleteIcon />,
|
||||
onClick: handleBatchDeleteClick,
|
||||
disabled: props.batchActionPending,
|
||||
},
|
||||
{
|
||||
tooltip: "Run",
|
||||
icon: <PlayArrowIcon />,
|
||||
onClick: handleBatchRunClick,
|
||||
disabled: props.batchActionPending,
|
||||
},
|
||||
]}
|
||||
menuItemActions={[
|
||||
{
|
||||
label: "Delete All",
|
||||
onClick: handleDeleteAllClick,
|
||||
disabled: props.allActionPending,
|
||||
},
|
||||
{
|
||||
label: "Run All",
|
||||
onClick: handleRunAllClick,
|
||||
disabled: props.allActionPending,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<TableContainer component={Paper}>
|
||||
<Table
|
||||
stickyHeader={true}
|
||||
className={classes.table}
|
||||
aria-label="archived tasks table"
|
||||
size="small"
|
||||
>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell padding="checkbox">
|
||||
<Checkbox
|
||||
indeterminate={numSelected > 0 && numSelected < rowCount}
|
||||
checked={rowCount > 0 && numSelected === rowCount}
|
||||
onChange={handleSelectAllClick}
|
||||
inputProps={{
|
||||
"aria-label": "select all tasks shown in the table",
|
||||
}}
|
||||
/>
|
||||
</TableCell>
|
||||
{columns.map((col) => (
|
||||
<TableCell key={col.key} align={col.align}>
|
||||
{col.label}
|
||||
</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{props.tasks.map((task) => (
|
||||
<Row
|
||||
key={task.key}
|
||||
task={task}
|
||||
isSelected={selectedKeys.includes(task.key)}
|
||||
onSelectChange={(checked: boolean) => {
|
||||
if (checked) {
|
||||
setSelectedKeys(selectedKeys.concat(task.key));
|
||||
} else {
|
||||
setSelectedKeys(
|
||||
selectedKeys.filter((key) => key !== task.key)
|
||||
);
|
||||
}
|
||||
}}
|
||||
onRunClick={() => {
|
||||
props.runArchivedTaskAsync(queue, task.key);
|
||||
}}
|
||||
onDeleteClick={() => {
|
||||
props.deleteArchivedTaskAsync(queue, task.key);
|
||||
}}
|
||||
allActionPending={props.allActionPending}
|
||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
||||
onActionCellLeave={() => setActiveTaskId("")}
|
||||
showActions={activeTaskId === task.id}
|
||||
/>
|
||||
))}
|
||||
</TableBody>
|
||||
<TableFooter>
|
||||
<TableRow>
|
||||
<TablePagination
|
||||
rowsPerPageOptions={rowsPerPageOptions}
|
||||
colSpan={columns.length + 1 /* checkbox col */}
|
||||
count={props.totalTaskCount}
|
||||
rowsPerPage={pageSize}
|
||||
page={page}
|
||||
SelectProps={{
|
||||
inputProps: { "aria-label": "rows per page" },
|
||||
native: true,
|
||||
}}
|
||||
onChangePage={handleChangePage}
|
||||
onChangeRowsPerPage={handleChangeRowsPerPage}
|
||||
ActionsComponent={TablePaginationActions}
|
||||
/>
|
||||
</TableRow>
|
||||
</TableFooter>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
interface RowProps {
|
||||
task: ArchivedTaskExtended;
|
||||
isSelected: boolean;
|
||||
onSelectChange: (checked: boolean) => void;
|
||||
onRunClick: () => void;
|
||||
onDeleteClick: () => void;
|
||||
allActionPending: boolean;
|
||||
showActions: boolean;
|
||||
onActionCellEnter: () => void;
|
||||
onActionCellLeave: () => void;
|
||||
}
|
||||
|
||||
function Row(props: RowProps) {
|
||||
const { task } = props;
|
||||
const [open, setOpen] = useState(false);
|
||||
const classes = useRowStyles();
|
||||
return (
|
||||
<React.Fragment>
|
||||
<TableRow
|
||||
key={task.id}
|
||||
className={classes.root}
|
||||
selected={props.isSelected}
|
||||
>
|
||||
<TableCell padding="checkbox">
|
||||
<Checkbox
|
||||
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||
props.onSelectChange(event.target.checked)
|
||||
}
|
||||
checked={props.isSelected}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Tooltip title={open ? "Hide Details" : "Show Details"}>
|
||||
<IconButton
|
||||
aria-label="expand row"
|
||||
size="small"
|
||||
onClick={() => setOpen(!open)}
|
||||
>
|
||||
{open ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell component="th" scope="row">
|
||||
{uuidPrefix(task.id)}
|
||||
</TableCell>
|
||||
<TableCell>{task.type}</TableCell>
|
||||
<TableCell>{timeAgo(task.last_failed_at)}</TableCell>
|
||||
<TableCell>{task.error_message}</TableCell>
|
||||
<TableCell
|
||||
align="center"
|
||||
className={clsx(
|
||||
classes.actionCell,
|
||||
props.showActions && classes.activeActionCell
|
||||
)}
|
||||
onMouseEnter={props.onActionCellEnter}
|
||||
onMouseLeave={props.onActionCellLeave}
|
||||
>
|
||||
{props.showActions ? (
|
||||
<React.Fragment>
|
||||
<Tooltip title="Delete">
|
||||
<IconButton
|
||||
onClick={props.onDeleteClick}
|
||||
disabled={task.requestPending || props.allActionPending}
|
||||
size="small"
|
||||
>
|
||||
<DeleteIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Run">
|
||||
<IconButton
|
||||
onClick={props.onRunClick}
|
||||
disabled={task.requestPending || props.allActionPending}
|
||||
size="small"
|
||||
>
|
||||
<PlayArrowIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<IconButton size="small" onClick={props.onActionCellEnter}>
|
||||
<MoreHorizIcon fontSize="small" />
|
||||
</IconButton>
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow selected={props.isSelected}>
|
||||
<TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={7}>
|
||||
<Collapse in={open} timeout="auto" unmountOnExit>
|
||||
<Box margin={1}>
|
||||
<Typography variant="h6" gutterBottom component="div">
|
||||
Payload
|
||||
</Typography>
|
||||
<SyntaxHighlighter language="json" style={syntaxHighlightStyle}>
|
||||
{JSON.stringify(task.payload, null, 2)}
|
||||
</SyntaxHighlighter>
|
||||
</Box>
|
||||
</Collapse>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default connector(ArchivedTasksTable);
|
@ -28,13 +28,13 @@ import SyntaxHighlighter from "react-syntax-highlighter";
|
||||
import syntaxHighlightStyle from "react-syntax-highlighter/dist/esm/styles/hljs/github";
|
||||
import { AppState } from "../store";
|
||||
import {
|
||||
batchDeleteDeadTasksAsync,
|
||||
batchRunDeadTasksAsync,
|
||||
deleteDeadTaskAsync,
|
||||
deleteAllDeadTasksAsync,
|
||||
listDeadTasksAsync,
|
||||
runDeadTaskAsync,
|
||||
runAllDeadTasksAsync,
|
||||
batchDeleteArchivedTasksAsync,
|
||||
batchRunArchivedTasksAsync,
|
||||
deleteArchivedTaskAsync,
|
||||
deleteAllArchivedTasksAsync,
|
||||
listArchivedTasksAsync,
|
||||
runArchivedTaskAsync,
|
||||
runAllArchivedTasksAsync,
|
||||
} from "../actions/tasksActions";
|
||||
import TablePaginationActions, {
|
||||
defaultPageSize,
|
||||
@ -43,7 +43,7 @@ import TablePaginationActions, {
|
||||
import TableActions from "./TableActions";
|
||||
import { timeAgo, uuidPrefix } from "../utils";
|
||||
import { usePolling } from "../hooks";
|
||||
import { DeadTaskExtended } from "../reducers/tasksReducer";
|
||||
import { ArchivedTaskExtended } from "../reducers/tasksReducer";
|
||||
import { TableColumn } from "../types/table";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
@ -69,22 +69,22 @@ const useRowStyles = makeStyles({
|
||||
|
||||
function mapStateToProps(state: AppState) {
|
||||
return {
|
||||
loading: state.tasks.deadTasks.loading,
|
||||
tasks: state.tasks.deadTasks.data,
|
||||
batchActionPending: state.tasks.deadTasks.batchActionPending,
|
||||
allActionPending: state.tasks.deadTasks.allActionPending,
|
||||
loading: state.tasks.archivedTasks.loading,
|
||||
tasks: state.tasks.archivedTasks.data,
|
||||
batchActionPending: state.tasks.archivedTasks.batchActionPending,
|
||||
allActionPending: state.tasks.archivedTasks.allActionPending,
|
||||
pollInterval: state.settings.pollInterval,
|
||||
};
|
||||
}
|
||||
|
||||
const mapDispatchToProps = {
|
||||
listDeadTasksAsync,
|
||||
runDeadTaskAsync,
|
||||
runAllDeadTasksAsync,
|
||||
deleteDeadTaskAsync,
|
||||
deleteAllDeadTasksAsync,
|
||||
batchRunDeadTasksAsync,
|
||||
batchDeleteDeadTasksAsync,
|
||||
listArchivedTasksAsync,
|
||||
runArchivedTaskAsync,
|
||||
runAllArchivedTasksAsync,
|
||||
deleteArchivedTaskAsync,
|
||||
deleteAllArchivedTasksAsync,
|
||||
batchRunArchivedTasksAsync,
|
||||
batchDeleteArchivedTasksAsync,
|
||||
};
|
||||
|
||||
const connector = connect(mapStateToProps, mapDispatchToProps);
|
||||
@ -93,11 +93,11 @@ type ReduxProps = ConnectedProps<typeof connector>;
|
||||
|
||||
interface Props {
|
||||
queue: string; // name of the queue.
|
||||
totalTaskCount: number; // totoal number of dead tasks.
|
||||
totalTaskCount: number; // totoal number of archived tasks.
|
||||
}
|
||||
|
||||
function DeadTasksTable(props: Props & ReduxProps) {
|
||||
const { pollInterval, listDeadTasksAsync, queue } = props;
|
||||
function ArchivedTasksTable(props: Props & ReduxProps) {
|
||||
const { pollInterval, listArchivedTasksAsync, queue } = props;
|
||||
const classes = useStyles();
|
||||
const [page, setPage] = useState(0);
|
||||
const [pageSize, setPageSize] = useState(defaultPageSize);
|
||||
@ -128,29 +128,29 @@ function DeadTasksTable(props: Props & ReduxProps) {
|
||||
};
|
||||
|
||||
const handleRunAllClick = () => {
|
||||
props.runAllDeadTasksAsync(queue);
|
||||
props.runAllArchivedTasksAsync(queue);
|
||||
};
|
||||
|
||||
const handleDeleteAllClick = () => {
|
||||
props.deleteAllDeadTasksAsync(queue);
|
||||
props.deleteAllArchivedTasksAsync(queue);
|
||||
};
|
||||
|
||||
const handleBatchRunClick = () => {
|
||||
props
|
||||
.batchRunDeadTasksAsync(queue, selectedKeys)
|
||||
.batchRunArchivedTasksAsync(queue, selectedKeys)
|
||||
.then(() => setSelectedKeys([]));
|
||||
};
|
||||
|
||||
const handleBatchDeleteClick = () => {
|
||||
props
|
||||
.batchDeleteDeadTasksAsync(queue, selectedKeys)
|
||||
.batchDeleteArchivedTasksAsync(queue, selectedKeys)
|
||||
.then(() => setSelectedKeys([]));
|
||||
};
|
||||
|
||||
const fetchData = useCallback(() => {
|
||||
const pageOpts = { page: page + 1, size: pageSize };
|
||||
listDeadTasksAsync(queue, pageOpts);
|
||||
}, [page, pageSize, queue, listDeadTasksAsync]);
|
||||
listArchivedTasksAsync(queue, pageOpts);
|
||||
}, [page, pageSize, queue, listArchivedTasksAsync]);
|
||||
|
||||
usePolling(fetchData, pollInterval);
|
||||
|
||||
@ -158,7 +158,7 @@ function DeadTasksTable(props: Props & ReduxProps) {
|
||||
return (
|
||||
<Alert severity="info">
|
||||
<AlertTitle>Info</AlertTitle>
|
||||
No dead tasks at this time.
|
||||
No archived tasks at this time.
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
@ -209,7 +209,7 @@ function DeadTasksTable(props: Props & ReduxProps) {
|
||||
<Table
|
||||
stickyHeader={true}
|
||||
className={classes.table}
|
||||
aria-label="dead tasks table"
|
||||
aria-label="archived tasks table"
|
||||
size="small"
|
||||
>
|
||||
<TableHead>
|
||||
@ -247,10 +247,10 @@ function DeadTasksTable(props: Props & ReduxProps) {
|
||||
}
|
||||
}}
|
||||
onRunClick={() => {
|
||||
props.runDeadTaskAsync(queue, task.key);
|
||||
props.runArchivedTaskAsync(queue, task.key);
|
||||
}}
|
||||
onDeleteClick={() => {
|
||||
props.deleteDeadTaskAsync(queue, task.key);
|
||||
props.deleteArchivedTaskAsync(queue, task.key);
|
||||
}}
|
||||
allActionPending={props.allActionPending}
|
||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
||||
@ -284,7 +284,7 @@ function DeadTasksTable(props: Props & ReduxProps) {
|
||||
}
|
||||
|
||||
interface RowProps {
|
||||
task: DeadTaskExtended;
|
||||
task: ArchivedTaskExtended;
|
||||
isSelected: boolean;
|
||||
onSelectChange: (checked: boolean) => void;
|
||||
onRunClick: () => void;
|
||||
@ -386,4 +386,4 @@ function Row(props: RowProps) {
|
||||
);
|
||||
}
|
||||
|
||||
export default connector(DeadTasksTable);
|
||||
export default connector(ArchivedTasksTable);
|
||||
|
@ -20,7 +20,7 @@ interface TaskBreakdown {
|
||||
pending: number; // number of pending tasks in the queue.
|
||||
scheduled: number; // number of scheduled tasks in the queue.
|
||||
retry: number; // number of retry tasks in the queue.
|
||||
dead: number; // number of dead tasks in the queue.
|
||||
archived: number; // number of archived tasks in the queue.
|
||||
}
|
||||
|
||||
function QueueSizeChart(props: Props) {
|
||||
@ -36,7 +36,7 @@ function QueueSizeChart(props: Props) {
|
||||
<Bar dataKey="pending" stackId="a" fill="#669df6" />
|
||||
<Bar dataKey="scheduled" stackId="a" fill="#fdd663" />
|
||||
<Bar dataKey="retry" stackId="a" fill="#f666a9" />
|
||||
<Bar dataKey="dead" stackId="a" fill="#ac4776" />
|
||||
<Bar dataKey="archived" stackId="a" fill="#ac4776" />
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
);
|
||||
|
@ -67,7 +67,7 @@ enum SortBy {
|
||||
Pending,
|
||||
Scheduled,
|
||||
Retry,
|
||||
Dead,
|
||||
Archived,
|
||||
|
||||
None, // no sort support
|
||||
}
|
||||
@ -84,7 +84,12 @@ const colConfigs: SortableTableColumn<SortBy>[] = [
|
||||
align: "right",
|
||||
},
|
||||
{ label: "Retry", key: "retry", sortBy: SortBy.Retry, align: "right" },
|
||||
{ label: "Dead", key: "dead", sortBy: SortBy.Dead, align: "right" },
|
||||
{
|
||||
label: "Archived",
|
||||
key: "archived",
|
||||
sortBy: SortBy.Archived,
|
||||
align: "right",
|
||||
},
|
||||
{ label: "Actions", key: "actions", sortBy: SortBy.None, align: "center" },
|
||||
];
|
||||
|
||||
@ -148,9 +153,9 @@ export default function QueuesOverviewTable(props: Props) {
|
||||
if (q1.retry === q2.retry) return 0;
|
||||
isQ1Smaller = q1.retry < q2.retry;
|
||||
break;
|
||||
case SortBy.Dead:
|
||||
if (q1.dead === q2.dead) return 0;
|
||||
isQ1Smaller = q1.dead < q2.dead;
|
||||
case SortBy.Archived:
|
||||
if (q1.archived === q2.archived) return 0;
|
||||
isQ1Smaller = q1.archived < q2.archived;
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-throw-literal
|
||||
@ -248,10 +253,10 @@ export default function QueuesOverviewTable(props: Props) {
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
<Link
|
||||
to={queueDetailsPath(q.queue, "dead")}
|
||||
to={queueDetailsPath(q.queue, "archived")}
|
||||
className={classes.linkCell}
|
||||
>
|
||||
{q.dead}
|
||||
{q.archived}
|
||||
</Link>
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
@ -318,7 +323,7 @@ export default function QueuesOverviewTable(props: Props) {
|
||||
{total.retry}
|
||||
</TableCell>
|
||||
<TableCell className={classes.footerCell} align="right">
|
||||
{total.dead}
|
||||
{total.archived}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableFooter>
|
||||
@ -338,7 +343,7 @@ interface AggregateCounts {
|
||||
pending: number;
|
||||
scheduled: number;
|
||||
retry: number;
|
||||
dead: number;
|
||||
archived: number;
|
||||
}
|
||||
|
||||
function getAggregateCounts(queues: Queue[]): AggregateCounts {
|
||||
@ -348,7 +353,7 @@ function getAggregateCounts(queues: Queue[]): AggregateCounts {
|
||||
pending: 0,
|
||||
scheduled: 0,
|
||||
retry: 0,
|
||||
dead: 0,
|
||||
archived: 0,
|
||||
};
|
||||
queues.forEach((q) => {
|
||||
total.size += q.size;
|
||||
@ -356,7 +361,7 @@ function getAggregateCounts(queues: Queue[]): AggregateCounts {
|
||||
total.pending += q.pending;
|
||||
total.scheduled += q.scheduled;
|
||||
total.retry += q.retry;
|
||||
total.dead += q.dead;
|
||||
total.archived += q.archived;
|
||||
});
|
||||
return total;
|
||||
}
|
||||
|
@ -29,14 +29,14 @@ import syntaxHighlightStyle from "react-syntax-highlighter/dist/esm/styles/hljs/
|
||||
import {
|
||||
batchDeleteRetryTasksAsync,
|
||||
batchRunRetryTasksAsync,
|
||||
batchKillRetryTasksAsync,
|
||||
batchArchiveRetryTasksAsync,
|
||||
deleteAllRetryTasksAsync,
|
||||
runAllRetryTasksAsync,
|
||||
killAllRetryTasksAsync,
|
||||
archiveAllRetryTasksAsync,
|
||||
listRetryTasksAsync,
|
||||
deleteRetryTaskAsync,
|
||||
runRetryTaskAsync,
|
||||
killRetryTaskAsync,
|
||||
archiveRetryTaskAsync,
|
||||
} from "../actions/tasksActions";
|
||||
import { AppState } from "../store";
|
||||
import TablePaginationActions, {
|
||||
@ -69,14 +69,14 @@ function mapStateToProps(state: AppState) {
|
||||
const mapDispatchToProps = {
|
||||
batchDeleteRetryTasksAsync,
|
||||
batchRunRetryTasksAsync,
|
||||
batchKillRetryTasksAsync,
|
||||
batchArchiveRetryTasksAsync,
|
||||
deleteAllRetryTasksAsync,
|
||||
runAllRetryTasksAsync,
|
||||
killAllRetryTasksAsync,
|
||||
archiveAllRetryTasksAsync,
|
||||
listRetryTasksAsync,
|
||||
deleteRetryTaskAsync,
|
||||
runRetryTaskAsync,
|
||||
killRetryTaskAsync,
|
||||
archiveRetryTaskAsync,
|
||||
};
|
||||
|
||||
const connector = connect(mapStateToProps, mapDispatchToProps);
|
||||
@ -127,8 +127,8 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
||||
props.deleteAllRetryTasksAsync(queue);
|
||||
};
|
||||
|
||||
const handleKillAllClick = () => {
|
||||
props.killAllRetryTasksAsync(queue);
|
||||
const handleArchiveAllClick = () => {
|
||||
props.archiveAllRetryTasksAsync(queue);
|
||||
};
|
||||
|
||||
const handleBatchRunClick = () => {
|
||||
@ -143,9 +143,9 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
||||
.then(() => setSelectedKeys([]));
|
||||
};
|
||||
|
||||
const handleBatchKillClick = () => {
|
||||
const handleBatchArchiveClick = () => {
|
||||
props
|
||||
.batchKillRetryTasksAsync(queue, selectedKeys)
|
||||
.batchArchiveRetryTasksAsync(queue, selectedKeys)
|
||||
.then(() => setSelectedKeys([]));
|
||||
};
|
||||
|
||||
@ -190,9 +190,9 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
||||
disabled: props.batchActionPending,
|
||||
},
|
||||
{
|
||||
tooltip: "Kill",
|
||||
tooltip: "Archive",
|
||||
icon: <ArchiveIcon />,
|
||||
onClick: handleBatchKillClick,
|
||||
onClick: handleBatchArchiveClick,
|
||||
disabled: props.batchActionPending,
|
||||
},
|
||||
{
|
||||
@ -209,8 +209,8 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
||||
disabled: props.allActionPending,
|
||||
},
|
||||
{
|
||||
label: "Kill All",
|
||||
onClick: handleKillAllClick,
|
||||
label: "Archive All",
|
||||
onClick: handleArchiveAllClick,
|
||||
disabled: props.allActionPending,
|
||||
},
|
||||
{
|
||||
@ -268,8 +268,8 @@ function RetryTasksTable(props: Props & ReduxProps) {
|
||||
onDeleteClick={() => {
|
||||
props.deleteRetryTaskAsync(task.queue, task.key);
|
||||
}}
|
||||
onKillClick={() => {
|
||||
props.killRetryTaskAsync(task.queue, task.key);
|
||||
onArchiveClick={() => {
|
||||
props.archiveRetryTaskAsync(task.queue, task.key);
|
||||
}}
|
||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
||||
onActionCellLeave={() => setActiveTaskId("")}
|
||||
@ -322,7 +322,7 @@ interface RowProps {
|
||||
onSelectChange: (checked: boolean) => void;
|
||||
onDeleteClick: () => void;
|
||||
onRunClick: () => void;
|
||||
onKillClick: () => void;
|
||||
onArchiveClick: () => void;
|
||||
allActionPending: boolean;
|
||||
showActions: boolean;
|
||||
onActionCellEnter: () => void;
|
||||
@ -387,9 +387,9 @@ function Row(props: RowProps) {
|
||||
<DeleteIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Kill">
|
||||
<Tooltip title="Archive">
|
||||
<IconButton
|
||||
onClick={props.onKillClick}
|
||||
onClick={props.onArchiveClick}
|
||||
disabled={task.requestPending || props.allActionPending}
|
||||
size="small"
|
||||
>
|
||||
|
@ -30,14 +30,14 @@ import syntaxHighlightStyle from "react-syntax-highlighter/dist/esm/styles/hljs/
|
||||
import {
|
||||
batchDeleteScheduledTasksAsync,
|
||||
batchRunScheduledTasksAsync,
|
||||
batchKillScheduledTasksAsync,
|
||||
batchArchiveScheduledTasksAsync,
|
||||
deleteAllScheduledTasksAsync,
|
||||
runAllScheduledTasksAsync,
|
||||
killAllScheduledTasksAsync,
|
||||
archiveAllScheduledTasksAsync,
|
||||
listScheduledTasksAsync,
|
||||
deleteScheduledTaskAsync,
|
||||
runScheduledTaskAsync,
|
||||
killScheduledTaskAsync,
|
||||
archiveScheduledTaskAsync,
|
||||
} from "../actions/tasksActions";
|
||||
import { AppState } from "../store";
|
||||
import TablePaginationActions, {
|
||||
@ -70,13 +70,13 @@ const mapDispatchToProps = {
|
||||
listScheduledTasksAsync,
|
||||
batchDeleteScheduledTasksAsync,
|
||||
batchRunScheduledTasksAsync,
|
||||
batchKillScheduledTasksAsync,
|
||||
batchArchiveScheduledTasksAsync,
|
||||
deleteAllScheduledTasksAsync,
|
||||
runAllScheduledTasksAsync,
|
||||
killAllScheduledTasksAsync,
|
||||
archiveAllScheduledTasksAsync,
|
||||
deleteScheduledTaskAsync,
|
||||
runScheduledTaskAsync,
|
||||
killScheduledTaskAsync,
|
||||
archiveScheduledTaskAsync,
|
||||
};
|
||||
|
||||
const connector = connect(mapStateToProps, mapDispatchToProps);
|
||||
@ -127,8 +127,8 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
||||
props.deleteAllScheduledTasksAsync(queue);
|
||||
};
|
||||
|
||||
const handleKillAllClick = () => {
|
||||
props.killAllScheduledTasksAsync(queue);
|
||||
const handleArchiveAllClick = () => {
|
||||
props.archiveAllScheduledTasksAsync(queue);
|
||||
};
|
||||
|
||||
const handleBatchRunClick = () => {
|
||||
@ -143,9 +143,9 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
||||
.then(() => setSelectedKeys([]));
|
||||
};
|
||||
|
||||
const handleBatchKillClick = () => {
|
||||
const handleBatchArchiveClick = () => {
|
||||
props
|
||||
.batchKillScheduledTasksAsync(queue, selectedKeys)
|
||||
.batchArchiveScheduledTasksAsync(queue, selectedKeys)
|
||||
.then(() => setSelectedKeys([]));
|
||||
};
|
||||
|
||||
@ -187,9 +187,9 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
||||
disabled: props.batchActionPending,
|
||||
},
|
||||
{
|
||||
tooltip: "Kill",
|
||||
tooltip: "Archive",
|
||||
icon: <ArchiveIcon />,
|
||||
onClick: handleBatchKillClick,
|
||||
onClick: handleBatchArchiveClick,
|
||||
disabled: props.batchActionPending,
|
||||
},
|
||||
{
|
||||
@ -206,8 +206,8 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
||||
disabled: props.allActionPending,
|
||||
},
|
||||
{
|
||||
label: "Kill All",
|
||||
onClick: handleKillAllClick,
|
||||
label: "Archive All",
|
||||
onClick: handleArchiveAllClick,
|
||||
disabled: props.allActionPending,
|
||||
},
|
||||
{
|
||||
@ -265,8 +265,8 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
|
||||
onDeleteClick={() => {
|
||||
props.deleteScheduledTaskAsync(queue, task.key);
|
||||
}}
|
||||
onKillClick={() => {
|
||||
props.killScheduledTaskAsync(queue, task.key);
|
||||
onArchiveClick={() => {
|
||||
props.archiveScheduledTaskAsync(queue, task.key);
|
||||
}}
|
||||
onActionCellEnter={() => setActiveTaskId(task.id)}
|
||||
onActionCellLeave={() => setActiveTaskId("")}
|
||||
@ -319,7 +319,7 @@ interface RowProps {
|
||||
onSelectChange: (checked: boolean) => void;
|
||||
onRunClick: () => void;
|
||||
onDeleteClick: () => void;
|
||||
onKillClick: () => void;
|
||||
onArchiveClick: () => void;
|
||||
allActionPending: boolean;
|
||||
showActions: boolean;
|
||||
onActionCellEnter: () => void;
|
||||
@ -381,9 +381,9 @@ function Row(props: RowProps) {
|
||||
<DeleteIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Kill">
|
||||
<Tooltip title="Archive">
|
||||
<IconButton
|
||||
onClick={props.onKillClick}
|
||||
onClick={props.onArchiveClick}
|
||||
disabled={task.requestPending || props.allActionPending}
|
||||
size="small"
|
||||
>
|
||||
|
@ -8,7 +8,7 @@ import ActiveTasksTable from "./ActiveTasksTable";
|
||||
import PendingTasksTable from "./PendingTasksTable";
|
||||
import ScheduledTasksTable from "./ScheduledTasksTable";
|
||||
import RetryTasksTable from "./RetryTasksTable";
|
||||
import DeadTasksTable from "./DeadTasksTable";
|
||||
import ArchivedTasksTable from "./ArchivedTasksTable";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import { queueDetailsPath } from "../paths";
|
||||
import { Typography } from "@material-ui/core";
|
||||
@ -166,7 +166,7 @@ function mapStatetoProps(state: AppState, ownProps: Props) {
|
||||
pending: 0,
|
||||
scheduled: 0,
|
||||
retry: 0,
|
||||
dead: 0,
|
||||
archived: 0,
|
||||
processed: 0,
|
||||
failed: 0,
|
||||
timestamp: "n/a",
|
||||
@ -246,15 +246,15 @@ function TasksTable(props: Props & ReduxProps) {
|
||||
{...a11yProps("retry")}
|
||||
/>
|
||||
<Tab
|
||||
value="dead"
|
||||
label="Dead"
|
||||
icon={<TaskCount>{currentStats.dead}</TaskCount>}
|
||||
value="archived"
|
||||
label="Archived"
|
||||
icon={<TaskCount>{currentStats.archived}</TaskCount>}
|
||||
classes={{
|
||||
root: classes.tabroot,
|
||||
wrapper: classes.tabwrapper,
|
||||
selected: classes.tabSelected,
|
||||
}}
|
||||
{...a11yProps("dead")}
|
||||
{...a11yProps("archived")}
|
||||
/>
|
||||
</Tabs>
|
||||
</TabsContainer>
|
||||
@ -311,7 +311,7 @@ function TasksTable(props: Props & ReduxProps) {
|
||||
/>
|
||||
</PanelContainer>
|
||||
</TabPanel>
|
||||
<TabPanel value="dead" selected={props.selected}>
|
||||
<TabPanel value="archived" selected={props.selected}>
|
||||
<PanelContainer>
|
||||
<PanelHeading
|
||||
queue={props.queue}
|
||||
@ -319,9 +319,9 @@ function TasksTable(props: Props & ReduxProps) {
|
||||
failed={currentStats.failed}
|
||||
paused={currentStats.paused}
|
||||
/>
|
||||
<DeadTasksTable
|
||||
<ArchivedTasksTable
|
||||
queue={props.queue}
|
||||
totalTaskCount={currentStats.dead}
|
||||
totalTaskCount={currentStats.archived}
|
||||
/>
|
||||
</PanelContainer>
|
||||
</TabPanel>
|
||||
|
@ -14,33 +14,33 @@ import {
|
||||
LIST_QUEUES_ERROR,
|
||||
} from "../actions/queuesActions";
|
||||
import {
|
||||
BATCH_DELETE_DEAD_TASKS_SUCCESS,
|
||||
BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
|
||||
BATCH_DELETE_RETRY_TASKS_SUCCESS,
|
||||
BATCH_DELETE_SCHEDULED_TASKS_SUCCESS,
|
||||
BATCH_KILL_RETRY_TASKS_SUCCESS,
|
||||
BATCH_KILL_SCHEDULED_TASKS_SUCCESS,
|
||||
BATCH_RUN_DEAD_TASKS_SUCCESS,
|
||||
BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
|
||||
BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
|
||||
BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
|
||||
BATCH_RUN_RETRY_TASKS_SUCCESS,
|
||||
BATCH_RUN_SCHEDULED_TASKS_SUCCESS,
|
||||
DELETE_ALL_DEAD_TASKS_SUCCESS,
|
||||
DELETE_ALL_ARCHIVED_TASKS_SUCCESS,
|
||||
DELETE_ALL_RETRY_TASKS_SUCCESS,
|
||||
DELETE_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
DELETE_DEAD_TASK_SUCCESS,
|
||||
DELETE_ARCHIVED_TASK_SUCCESS,
|
||||
DELETE_RETRY_TASK_SUCCESS,
|
||||
DELETE_SCHEDULED_TASK_SUCCESS,
|
||||
KILL_ALL_RETRY_TASKS_SUCCESS,
|
||||
KILL_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
KILL_RETRY_TASK_SUCCESS,
|
||||
KILL_SCHEDULED_TASK_SUCCESS,
|
||||
ARCHIVE_ALL_RETRY_TASKS_SUCCESS,
|
||||
ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
ARCHIVE_RETRY_TASK_SUCCESS,
|
||||
ARCHIVE_SCHEDULED_TASK_SUCCESS,
|
||||
LIST_ACTIVE_TASKS_SUCCESS,
|
||||
LIST_DEAD_TASKS_SUCCESS,
|
||||
LIST_ARCHIVED_TASKS_SUCCESS,
|
||||
LIST_PENDING_TASKS_SUCCESS,
|
||||
LIST_RETRY_TASKS_SUCCESS,
|
||||
LIST_SCHEDULED_TASKS_SUCCESS,
|
||||
RUN_ALL_DEAD_TASKS_SUCCESS,
|
||||
RUN_ALL_ARCHIVED_TASKS_SUCCESS,
|
||||
RUN_ALL_RETRY_TASKS_SUCCESS,
|
||||
RUN_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
RUN_DEAD_TASK_SUCCESS,
|
||||
RUN_ARCHIVED_TASK_SUCCESS,
|
||||
RUN_RETRY_TASK_SUCCESS,
|
||||
RUN_SCHEDULED_TASK_SUCCESS,
|
||||
TasksActionTypes,
|
||||
@ -155,7 +155,7 @@ function queuesReducer(
|
||||
case LIST_PENDING_TASKS_SUCCESS:
|
||||
case LIST_SCHEDULED_TASKS_SUCCESS:
|
||||
case LIST_RETRY_TASKS_SUCCESS:
|
||||
case LIST_DEAD_TASKS_SUCCESS: {
|
||||
case LIST_ARCHIVED_TASKS_SUCCESS: {
|
||||
const newData = state.data
|
||||
.filter((queueInfo) => queueInfo.name !== action.queue)
|
||||
.concat({
|
||||
@ -200,7 +200,7 @@ function queuesReducer(
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case RUN_DEAD_TASK_SUCCESS: {
|
||||
case RUN_ARCHIVED_TASK_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -210,14 +210,14 @@ function queuesReducer(
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
pending: queueInfo.currentStats.pending + 1,
|
||||
dead: queueInfo.currentStats.dead - 1,
|
||||
archived: queueInfo.currentStats.archived - 1,
|
||||
},
|
||||
};
|
||||
});
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case KILL_SCHEDULED_TASK_SUCCESS: {
|
||||
case ARCHIVE_SCHEDULED_TASK_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -226,7 +226,7 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead: queueInfo.currentStats.dead + 1,
|
||||
archived: queueInfo.currentStats.archived + 1,
|
||||
scheduled: queueInfo.currentStats.scheduled - 1,
|
||||
},
|
||||
};
|
||||
@ -234,7 +234,7 @@ function queuesReducer(
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case KILL_RETRY_TASK_SUCCESS: {
|
||||
case ARCHIVE_RETRY_TASK_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -243,7 +243,7 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead: queueInfo.currentStats.dead + 1,
|
||||
archived: queueInfo.currentStats.archived + 1,
|
||||
retry: queueInfo.currentStats.retry - 1,
|
||||
},
|
||||
};
|
||||
@ -288,7 +288,7 @@ function queuesReducer(
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case BATCH_KILL_SCHEDULED_TASKS_SUCCESS: {
|
||||
case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -297,10 +297,12 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead: queueInfo.currentStats.dead + action.payload.dead_keys.length,
|
||||
archived:
|
||||
queueInfo.currentStats.archived +
|
||||
action.payload.archived_keys.length,
|
||||
scheduled:
|
||||
queueInfo.currentStats.scheduled -
|
||||
action.payload.dead_keys.length,
|
||||
action.payload.archived_keys.length,
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -343,7 +345,7 @@ function queuesReducer(
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case KILL_ALL_SCHEDULED_TASKS_SUCCESS: {
|
||||
case ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -352,8 +354,9 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead:
|
||||
queueInfo.currentStats.dead + queueInfo.currentStats.scheduled,
|
||||
archived:
|
||||
queueInfo.currentStats.archived +
|
||||
queueInfo.currentStats.scheduled,
|
||||
scheduled: 0,
|
||||
},
|
||||
};
|
||||
@ -413,7 +416,7 @@ function queuesReducer(
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case BATCH_KILL_RETRY_TASKS_SUCCESS: {
|
||||
case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -422,10 +425,12 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead:
|
||||
queueInfo.currentStats.pending + action.payload.dead_keys.length,
|
||||
archived:
|
||||
queueInfo.currentStats.pending +
|
||||
action.payload.archived_keys.length,
|
||||
retry:
|
||||
queueInfo.currentStats.retry - action.payload.dead_keys.length,
|
||||
queueInfo.currentStats.retry -
|
||||
action.payload.archived_keys.length,
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -467,7 +472,7 @@ function queuesReducer(
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case KILL_ALL_RETRY_TASKS_SUCCESS: {
|
||||
case ARCHIVE_ALL_RETRY_TASKS_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -476,7 +481,8 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead: queueInfo.currentStats.dead + queueInfo.currentStats.retry,
|
||||
archived:
|
||||
queueInfo.currentStats.archived + queueInfo.currentStats.retry,
|
||||
retry: 0,
|
||||
},
|
||||
};
|
||||
@ -500,7 +506,7 @@ function queuesReducer(
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case DELETE_DEAD_TASK_SUCCESS: {
|
||||
case DELETE_ARCHIVED_TASK_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -509,14 +515,14 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead: queueInfo.currentStats.dead - 1,
|
||||
archived: queueInfo.currentStats.archived - 1,
|
||||
},
|
||||
};
|
||||
});
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case BATCH_RUN_DEAD_TASKS_SUCCESS: {
|
||||
case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -528,15 +534,16 @@ function queuesReducer(
|
||||
pending:
|
||||
queueInfo.currentStats.pending +
|
||||
action.payload.pending_keys.length,
|
||||
dead:
|
||||
queueInfo.currentStats.dead - action.payload.pending_keys.length,
|
||||
archived:
|
||||
queueInfo.currentStats.archived -
|
||||
action.payload.pending_keys.length,
|
||||
},
|
||||
};
|
||||
});
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case BATCH_DELETE_DEAD_TASKS_SUCCESS: {
|
||||
case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -545,15 +552,16 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead:
|
||||
queueInfo.currentStats.dead - action.payload.deleted_keys.length,
|
||||
archived:
|
||||
queueInfo.currentStats.archived -
|
||||
action.payload.deleted_keys.length,
|
||||
},
|
||||
};
|
||||
});
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case RUN_ALL_DEAD_TASKS_SUCCESS: {
|
||||
case RUN_ALL_ARCHIVED_TASKS_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -563,15 +571,15 @@ function queuesReducer(
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
pending:
|
||||
queueInfo.currentStats.pending + queueInfo.currentStats.dead,
|
||||
dead: 0,
|
||||
queueInfo.currentStats.pending + queueInfo.currentStats.archived,
|
||||
archived: 0,
|
||||
},
|
||||
};
|
||||
});
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
|
||||
case DELETE_ALL_DEAD_TASKS_SUCCESS: {
|
||||
case DELETE_ALL_ARCHIVED_TASKS_SUCCESS: {
|
||||
const newData = state.data.map((queueInfo) => {
|
||||
if (queueInfo.name !== action.queue) {
|
||||
return queueInfo;
|
||||
@ -580,7 +588,7 @@ function queuesReducer(
|
||||
...queueInfo,
|
||||
currentStats: {
|
||||
...queueInfo.currentStats,
|
||||
dead: 0,
|
||||
archived: 0,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
@ -4,29 +4,29 @@ import {
|
||||
} from "../actions/snackbarActions";
|
||||
import {
|
||||
BATCH_CANCEL_ACTIVE_TASKS_SUCCESS,
|
||||
BATCH_DELETE_DEAD_TASKS_SUCCESS,
|
||||
BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
|
||||
BATCH_DELETE_RETRY_TASKS_SUCCESS,
|
||||
BATCH_DELETE_SCHEDULED_TASKS_SUCCESS,
|
||||
BATCH_KILL_RETRY_TASKS_SUCCESS,
|
||||
BATCH_KILL_SCHEDULED_TASKS_SUCCESS,
|
||||
BATCH_RUN_DEAD_TASKS_SUCCESS,
|
||||
BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
|
||||
BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
|
||||
BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
|
||||
BATCH_RUN_RETRY_TASKS_SUCCESS,
|
||||
BATCH_RUN_SCHEDULED_TASKS_SUCCESS,
|
||||
CANCEL_ALL_ACTIVE_TASKS_SUCCESS,
|
||||
DELETE_ALL_DEAD_TASKS_SUCCESS,
|
||||
DELETE_ALL_ARCHIVED_TASKS_SUCCESS,
|
||||
DELETE_ALL_RETRY_TASKS_SUCCESS,
|
||||
DELETE_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
DELETE_DEAD_TASK_SUCCESS,
|
||||
DELETE_ARCHIVED_TASK_SUCCESS,
|
||||
DELETE_RETRY_TASK_SUCCESS,
|
||||
DELETE_SCHEDULED_TASK_SUCCESS,
|
||||
KILL_ALL_RETRY_TASKS_SUCCESS,
|
||||
KILL_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
KILL_RETRY_TASK_SUCCESS,
|
||||
KILL_SCHEDULED_TASK_SUCCESS,
|
||||
RUN_ALL_DEAD_TASKS_SUCCESS,
|
||||
ARCHIVE_ALL_RETRY_TASKS_SUCCESS,
|
||||
ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
ARCHIVE_RETRY_TASK_SUCCESS,
|
||||
ARCHIVE_SCHEDULED_TASK_SUCCESS,
|
||||
RUN_ALL_ARCHIVED_TASKS_SUCCESS,
|
||||
RUN_ALL_RETRY_TASKS_SUCCESS,
|
||||
RUN_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
RUN_DEAD_TASK_SUCCESS,
|
||||
RUN_ARCHIVED_TASK_SUCCESS,
|
||||
RUN_RETRY_TASK_SUCCESS,
|
||||
RUN_SCHEDULED_TASK_SUCCESS,
|
||||
TasksActionTypes,
|
||||
@ -83,22 +83,22 @@ function snackbarReducer(
|
||||
message: `Retry task is now pending`,
|
||||
};
|
||||
|
||||
case RUN_DEAD_TASK_SUCCESS:
|
||||
case RUN_ARCHIVED_TASK_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `Dead task is now pending`,
|
||||
message: `Archived task is now pending`,
|
||||
};
|
||||
|
||||
case KILL_SCHEDULED_TASK_SUCCESS:
|
||||
case ARCHIVE_SCHEDULED_TASK_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `Scheduled task is now dead`,
|
||||
message: `Scheduled task is now archived`,
|
||||
};
|
||||
|
||||
case KILL_RETRY_TASK_SUCCESS:
|
||||
case ARCHIVE_RETRY_TASK_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `Retry task is now dead`,
|
||||
message: `Retry task is now archived`,
|
||||
};
|
||||
|
||||
case DELETE_SCHEDULED_TASK_SUCCESS:
|
||||
@ -117,11 +117,13 @@ function snackbarReducer(
|
||||
};
|
||||
}
|
||||
|
||||
case BATCH_KILL_SCHEDULED_TASKS_SUCCESS: {
|
||||
const n = action.payload.dead_keys.length;
|
||||
case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
|
||||
const n = action.payload.archived_keys.length;
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `${n} scheduled ${n === 1 ? "task is" : "tasks are"} now dead`,
|
||||
message: `${n} scheduled ${
|
||||
n === 1 ? "task is" : "tasks are"
|
||||
} now archived`,
|
||||
};
|
||||
}
|
||||
|
||||
@ -139,10 +141,10 @@ function snackbarReducer(
|
||||
message: "All scheduled tasks are now pending",
|
||||
};
|
||||
|
||||
case KILL_ALL_SCHEDULED_TASKS_SUCCESS:
|
||||
case ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: "All scheduled tasks are now dead",
|
||||
message: "All scheduled tasks are now archived",
|
||||
};
|
||||
|
||||
case DELETE_ALL_SCHEDULED_TASKS_SUCCESS:
|
||||
@ -165,11 +167,11 @@ function snackbarReducer(
|
||||
};
|
||||
}
|
||||
|
||||
case BATCH_KILL_RETRY_TASKS_SUCCESS: {
|
||||
const n = action.payload.dead_keys.length;
|
||||
case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
|
||||
const n = action.payload.archived_keys.length;
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `${n} retry ${n === 1 ? "task is" : "tasks are"} now dead`,
|
||||
message: `${n} retry ${n === 1 ? "task is" : "tasks are"} now archived`,
|
||||
};
|
||||
}
|
||||
|
||||
@ -187,10 +189,10 @@ function snackbarReducer(
|
||||
message: "All retry tasks are now pending",
|
||||
};
|
||||
|
||||
case KILL_ALL_RETRY_TASKS_SUCCESS:
|
||||
case ARCHIVE_ALL_RETRY_TASKS_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: "All retry tasks are now dead",
|
||||
message: "All retry tasks are now archived",
|
||||
};
|
||||
|
||||
case DELETE_ALL_RETRY_TASKS_SUCCESS:
|
||||
@ -199,38 +201,40 @@ function snackbarReducer(
|
||||
message: "All retry tasks deleted",
|
||||
};
|
||||
|
||||
case DELETE_DEAD_TASK_SUCCESS:
|
||||
case DELETE_ARCHIVED_TASK_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `Dead task deleted`,
|
||||
message: `Archived task deleted`,
|
||||
};
|
||||
|
||||
case BATCH_RUN_DEAD_TASKS_SUCCESS: {
|
||||
case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
|
||||
const n = action.payload.pending_keys.length;
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `${n} dead ${n === 1 ? "task is" : "tasks are"} now pending`,
|
||||
message: `${n} archived ${
|
||||
n === 1 ? "task is" : "tasks are"
|
||||
} now pending`,
|
||||
};
|
||||
}
|
||||
|
||||
case BATCH_DELETE_DEAD_TASKS_SUCCESS: {
|
||||
case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
|
||||
const n = action.payload.deleted_keys.length;
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `${n} dead ${n === 1 ? "task" : "tasks"} deleted`,
|
||||
message: `${n} archived ${n === 1 ? "task" : "tasks"} deleted`,
|
||||
};
|
||||
}
|
||||
|
||||
case RUN_ALL_DEAD_TASKS_SUCCESS:
|
||||
case RUN_ALL_ARCHIVED_TASKS_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: "All dead tasks are now pending",
|
||||
message: "All archived tasks are now pending",
|
||||
};
|
||||
|
||||
case DELETE_ALL_DEAD_TASKS_SUCCESS:
|
||||
case DELETE_ALL_ARCHIVED_TASKS_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: "All dead tasks deleted",
|
||||
message: "All archived tasks deleted",
|
||||
};
|
||||
|
||||
default:
|
||||
|
@ -12,9 +12,9 @@ import {
|
||||
LIST_RETRY_TASKS_BEGIN,
|
||||
LIST_RETRY_TASKS_SUCCESS,
|
||||
LIST_RETRY_TASKS_ERROR,
|
||||
LIST_DEAD_TASKS_BEGIN,
|
||||
LIST_DEAD_TASKS_SUCCESS,
|
||||
LIST_DEAD_TASKS_ERROR,
|
||||
LIST_ARCHIVED_TASKS_BEGIN,
|
||||
LIST_ARCHIVED_TASKS_SUCCESS,
|
||||
LIST_ARCHIVED_TASKS_ERROR,
|
||||
CANCEL_ACTIVE_TASK_BEGIN,
|
||||
CANCEL_ACTIVE_TASK_SUCCESS,
|
||||
CANCEL_ACTIVE_TASK_ERROR,
|
||||
@ -24,24 +24,24 @@ import {
|
||||
DELETE_SCHEDULED_TASK_BEGIN,
|
||||
DELETE_SCHEDULED_TASK_SUCCESS,
|
||||
DELETE_SCHEDULED_TASK_ERROR,
|
||||
DELETE_DEAD_TASK_BEGIN,
|
||||
DELETE_DEAD_TASK_SUCCESS,
|
||||
DELETE_DEAD_TASK_ERROR,
|
||||
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,
|
||||
BATCH_RUN_DEAD_TASKS_BEGIN,
|
||||
BATCH_RUN_DEAD_TASKS_ERROR,
|
||||
BATCH_RUN_DEAD_TASKS_SUCCESS,
|
||||
DELETE_ALL_DEAD_TASKS_BEGIN,
|
||||
DELETE_ALL_DEAD_TASKS_SUCCESS,
|
||||
DELETE_ALL_DEAD_TASKS_ERROR,
|
||||
RUN_ALL_DEAD_TASKS_BEGIN,
|
||||
RUN_ALL_DEAD_TASKS_ERROR,
|
||||
RUN_ALL_DEAD_TASKS_SUCCESS,
|
||||
DELETE_ARCHIVED_TASK_BEGIN,
|
||||
DELETE_ARCHIVED_TASK_SUCCESS,
|
||||
DELETE_ARCHIVED_TASK_ERROR,
|
||||
BATCH_DELETE_ARCHIVED_TASKS_BEGIN,
|
||||
BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
|
||||
BATCH_DELETE_ARCHIVED_TASKS_ERROR,
|
||||
RUN_ARCHIVED_TASK_BEGIN,
|
||||
RUN_ARCHIVED_TASK_SUCCESS,
|
||||
RUN_ARCHIVED_TASK_ERROR,
|
||||
BATCH_RUN_ARCHIVED_TASKS_BEGIN,
|
||||
BATCH_RUN_ARCHIVED_TASKS_ERROR,
|
||||
BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
|
||||
DELETE_ALL_ARCHIVED_TASKS_BEGIN,
|
||||
DELETE_ALL_ARCHIVED_TASKS_SUCCESS,
|
||||
DELETE_ALL_ARCHIVED_TASKS_ERROR,
|
||||
RUN_ALL_ARCHIVED_TASKS_BEGIN,
|
||||
RUN_ALL_ARCHIVED_TASKS_ERROR,
|
||||
RUN_ALL_ARCHIVED_TASKS_SUCCESS,
|
||||
BATCH_DELETE_RETRY_TASKS_ERROR,
|
||||
BATCH_RUN_RETRY_TASKS_ERROR,
|
||||
BATCH_DELETE_RETRY_TASKS_SUCCESS,
|
||||
@ -72,24 +72,24 @@ import {
|
||||
RUN_SCHEDULED_TASK_BEGIN,
|
||||
RUN_SCHEDULED_TASK_SUCCESS,
|
||||
RUN_SCHEDULED_TASK_ERROR,
|
||||
KILL_SCHEDULED_TASK_BEGIN,
|
||||
KILL_SCHEDULED_TASK_SUCCESS,
|
||||
KILL_SCHEDULED_TASK_ERROR,
|
||||
KILL_ALL_SCHEDULED_TASKS_BEGIN,
|
||||
KILL_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
KILL_ALL_SCHEDULED_TASKS_ERROR,
|
||||
BATCH_KILL_SCHEDULED_TASKS_BEGIN,
|
||||
BATCH_KILL_SCHEDULED_TASKS_ERROR,
|
||||
BATCH_KILL_SCHEDULED_TASKS_SUCCESS,
|
||||
KILL_RETRY_TASK_BEGIN,
|
||||
KILL_RETRY_TASK_SUCCESS,
|
||||
KILL_RETRY_TASK_ERROR,
|
||||
KILL_ALL_RETRY_TASKS_BEGIN,
|
||||
KILL_ALL_RETRY_TASKS_SUCCESS,
|
||||
KILL_ALL_RETRY_TASKS_ERROR,
|
||||
BATCH_KILL_RETRY_TASKS_SUCCESS,
|
||||
BATCH_KILL_RETRY_TASKS_BEGIN,
|
||||
BATCH_KILL_RETRY_TASKS_ERROR,
|
||||
ARCHIVE_SCHEDULED_TASK_BEGIN,
|
||||
ARCHIVE_SCHEDULED_TASK_SUCCESS,
|
||||
ARCHIVE_SCHEDULED_TASK_ERROR,
|
||||
ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN,
|
||||
ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS,
|
||||
ARCHIVE_ALL_SCHEDULED_TASKS_ERROR,
|
||||
BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN,
|
||||
BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR,
|
||||
BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
|
||||
ARCHIVE_RETRY_TASK_BEGIN,
|
||||
ARCHIVE_RETRY_TASK_SUCCESS,
|
||||
ARCHIVE_RETRY_TASK_ERROR,
|
||||
ARCHIVE_ALL_RETRY_TASKS_BEGIN,
|
||||
ARCHIVE_ALL_RETRY_TASKS_SUCCESS,
|
||||
ARCHIVE_ALL_RETRY_TASKS_ERROR,
|
||||
BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
|
||||
BATCH_ARCHIVE_RETRY_TASKS_BEGIN,
|
||||
BATCH_ARCHIVE_RETRY_TASKS_ERROR,
|
||||
BATCH_CANCEL_ACTIVE_TASKS_BEGIN,
|
||||
BATCH_CANCEL_ACTIVE_TASKS_SUCCESS,
|
||||
BATCH_CANCEL_ACTIVE_TASKS_ERROR,
|
||||
@ -99,7 +99,7 @@ import {
|
||||
} from "../actions/tasksActions";
|
||||
import {
|
||||
ActiveTask,
|
||||
DeadTask,
|
||||
ArchivedTask,
|
||||
PendingTask,
|
||||
RetryTask,
|
||||
ScheduledTask,
|
||||
@ -127,7 +127,7 @@ export interface RetryTaskExtended extends RetryTask {
|
||||
requestPending: boolean;
|
||||
}
|
||||
|
||||
export interface DeadTaskExtended extends DeadTask {
|
||||
export interface ArchivedTaskExtended extends ArchivedTask {
|
||||
// Indicates that a request has been sent for this
|
||||
// task and awaiting for a response.
|
||||
requestPending: boolean;
|
||||
@ -160,12 +160,12 @@ interface TasksState {
|
||||
error: string;
|
||||
data: RetryTaskExtended[];
|
||||
};
|
||||
deadTasks: {
|
||||
archivedTasks: {
|
||||
loading: boolean;
|
||||
batchActionPending: boolean;
|
||||
allActionPending: boolean;
|
||||
error: string;
|
||||
data: DeadTaskExtended[];
|
||||
data: ArchivedTaskExtended[];
|
||||
};
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ const initialState: TasksState = {
|
||||
error: "",
|
||||
data: [],
|
||||
},
|
||||
deadTasks: {
|
||||
archivedTasks: {
|
||||
loading: false,
|
||||
batchActionPending: false,
|
||||
allActionPending: false,
|
||||
@ -343,21 +343,21 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case LIST_DEAD_TASKS_BEGIN:
|
||||
case LIST_ARCHIVED_TASKS_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
error: "",
|
||||
loading: true,
|
||||
},
|
||||
};
|
||||
|
||||
case LIST_DEAD_TASKS_SUCCESS:
|
||||
case LIST_ARCHIVED_TASKS_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
loading: false,
|
||||
error: "",
|
||||
data: action.payload.tasks.map((task) => ({
|
||||
@ -367,11 +367,11 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case LIST_DEAD_TASKS_ERROR:
|
||||
case LIST_ARCHIVED_TASKS_ERROR:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
loading: false,
|
||||
error: action.error,
|
||||
},
|
||||
@ -522,7 +522,7 @@ function tasksReducer(
|
||||
}
|
||||
|
||||
case RUN_SCHEDULED_TASK_BEGIN:
|
||||
case KILL_SCHEDULED_TASK_BEGIN:
|
||||
case ARCHIVE_SCHEDULED_TASK_BEGIN:
|
||||
case DELETE_SCHEDULED_TASK_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
@ -538,7 +538,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_SCHEDULED_TASK_SUCCESS:
|
||||
case KILL_SCHEDULED_TASK_SUCCESS:
|
||||
case ARCHIVE_SCHEDULED_TASK_SUCCESS:
|
||||
case DELETE_SCHEDULED_TASK_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
@ -551,7 +551,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_SCHEDULED_TASK_ERROR:
|
||||
case KILL_SCHEDULED_TASK_ERROR:
|
||||
case ARCHIVE_SCHEDULED_TASK_ERROR:
|
||||
case DELETE_SCHEDULED_TASK_ERROR:
|
||||
return {
|
||||
...state,
|
||||
@ -567,7 +567,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_ALL_SCHEDULED_TASKS_BEGIN:
|
||||
case KILL_ALL_SCHEDULED_TASKS_BEGIN:
|
||||
case ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN:
|
||||
case DELETE_ALL_SCHEDULED_TASKS_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
@ -578,7 +578,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_ALL_SCHEDULED_TASKS_SUCCESS:
|
||||
case KILL_ALL_SCHEDULED_TASKS_SUCCESS:
|
||||
case ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS:
|
||||
case DELETE_ALL_SCHEDULED_TASKS_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
@ -590,7 +590,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_ALL_SCHEDULED_TASKS_ERROR:
|
||||
case KILL_ALL_SCHEDULED_TASKS_ERROR:
|
||||
case ARCHIVE_ALL_SCHEDULED_TASKS_ERROR:
|
||||
case DELETE_ALL_SCHEDULED_TASKS_ERROR:
|
||||
return {
|
||||
...state,
|
||||
@ -601,7 +601,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case BATCH_RUN_SCHEDULED_TASKS_BEGIN:
|
||||
case BATCH_KILL_SCHEDULED_TASKS_BEGIN:
|
||||
case BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN:
|
||||
case BATCH_DELETE_SCHEDULED_TASKS_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
@ -634,9 +634,9 @@ function tasksReducer(
|
||||
};
|
||||
}
|
||||
|
||||
case BATCH_KILL_SCHEDULED_TASKS_SUCCESS: {
|
||||
case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
|
||||
const newData = state.scheduledTasks.data.filter(
|
||||
(task) => !action.payload.dead_keys.includes(task.key)
|
||||
(task) => !action.payload.archived_keys.includes(task.key)
|
||||
);
|
||||
return {
|
||||
...state,
|
||||
@ -663,7 +663,7 @@ function tasksReducer(
|
||||
}
|
||||
|
||||
case BATCH_RUN_SCHEDULED_TASKS_ERROR:
|
||||
case BATCH_KILL_SCHEDULED_TASKS_ERROR:
|
||||
case BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR:
|
||||
case BATCH_DELETE_SCHEDULED_TASKS_ERROR:
|
||||
return {
|
||||
...state,
|
||||
@ -683,7 +683,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_RETRY_TASK_BEGIN:
|
||||
case KILL_RETRY_TASK_BEGIN:
|
||||
case ARCHIVE_RETRY_TASK_BEGIN:
|
||||
case DELETE_RETRY_TASK_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
@ -699,7 +699,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_RETRY_TASK_SUCCESS:
|
||||
case KILL_RETRY_TASK_SUCCESS:
|
||||
case ARCHIVE_RETRY_TASK_SUCCESS:
|
||||
case DELETE_RETRY_TASK_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
@ -712,7 +712,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_RETRY_TASK_ERROR:
|
||||
case KILL_RETRY_TASK_ERROR:
|
||||
case ARCHIVE_RETRY_TASK_ERROR:
|
||||
case DELETE_RETRY_TASK_ERROR:
|
||||
return {
|
||||
...state,
|
||||
@ -728,7 +728,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_ALL_RETRY_TASKS_BEGIN:
|
||||
case KILL_ALL_RETRY_TASKS_BEGIN:
|
||||
case ARCHIVE_ALL_RETRY_TASKS_BEGIN:
|
||||
case DELETE_ALL_RETRY_TASKS_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
@ -739,7 +739,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_ALL_RETRY_TASKS_SUCCESS:
|
||||
case KILL_ALL_RETRY_TASKS_SUCCESS:
|
||||
case ARCHIVE_ALL_RETRY_TASKS_SUCCESS:
|
||||
case DELETE_ALL_RETRY_TASKS_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
@ -751,7 +751,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case RUN_ALL_RETRY_TASKS_ERROR:
|
||||
case KILL_ALL_RETRY_TASKS_ERROR:
|
||||
case ARCHIVE_ALL_RETRY_TASKS_ERROR:
|
||||
case DELETE_ALL_RETRY_TASKS_ERROR:
|
||||
return {
|
||||
...state,
|
||||
@ -762,7 +762,7 @@ function tasksReducer(
|
||||
};
|
||||
|
||||
case BATCH_RUN_RETRY_TASKS_BEGIN:
|
||||
case BATCH_KILL_RETRY_TASKS_BEGIN:
|
||||
case BATCH_ARCHIVE_RETRY_TASKS_BEGIN:
|
||||
case BATCH_DELETE_RETRY_TASKS_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
@ -795,9 +795,9 @@ function tasksReducer(
|
||||
};
|
||||
}
|
||||
|
||||
case BATCH_KILL_RETRY_TASKS_SUCCESS: {
|
||||
case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
|
||||
const newData = state.retryTasks.data.filter(
|
||||
(task) => !action.payload.dead_keys.includes(task.key)
|
||||
(task) => !action.payload.archived_keys.includes(task.key)
|
||||
);
|
||||
return {
|
||||
...state,
|
||||
@ -824,7 +824,7 @@ function tasksReducer(
|
||||
}
|
||||
|
||||
case BATCH_RUN_RETRY_TASKS_ERROR:
|
||||
case BATCH_KILL_RETRY_TASKS_ERROR:
|
||||
case BATCH_ARCHIVE_RETRY_TASKS_ERROR:
|
||||
case BATCH_DELETE_RETRY_TASKS_ERROR:
|
||||
return {
|
||||
...state,
|
||||
@ -843,13 +843,13 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_DEAD_TASK_BEGIN:
|
||||
case DELETE_DEAD_TASK_BEGIN:
|
||||
case RUN_ARCHIVED_TASK_BEGIN:
|
||||
case DELETE_ARCHIVED_TASK_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
data: state.deadTasks.data.map((task) => {
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
data: state.archivedTasks.data.map((task) => {
|
||||
if (task.key !== action.taskKey) {
|
||||
return task;
|
||||
}
|
||||
@ -858,25 +858,25 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_DEAD_TASK_SUCCESS:
|
||||
case DELETE_DEAD_TASK_SUCCESS:
|
||||
case RUN_ARCHIVED_TASK_SUCCESS:
|
||||
case DELETE_ARCHIVED_TASK_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
data: state.deadTasks.data.filter(
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
data: state.archivedTasks.data.filter(
|
||||
(task) => task.key !== action.taskKey
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_DEAD_TASK_ERROR:
|
||||
case DELETE_DEAD_TASK_ERROR:
|
||||
case RUN_ARCHIVED_TASK_ERROR:
|
||||
case DELETE_ARCHIVED_TASK_ERROR:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
data: state.deadTasks.data.map((task) => {
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
data: state.archivedTasks.data.map((task) => {
|
||||
if (task.key !== action.taskKey) {
|
||||
return task;
|
||||
}
|
||||
@ -885,45 +885,45 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_ALL_DEAD_TASKS_BEGIN:
|
||||
case DELETE_ALL_DEAD_TASKS_BEGIN:
|
||||
case RUN_ALL_ARCHIVED_TASKS_BEGIN:
|
||||
case DELETE_ALL_ARCHIVED_TASKS_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
allActionPending: true,
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_ALL_DEAD_TASKS_SUCCESS:
|
||||
case DELETE_ALL_DEAD_TASKS_SUCCESS:
|
||||
case RUN_ALL_ARCHIVED_TASKS_SUCCESS:
|
||||
case DELETE_ALL_ARCHIVED_TASKS_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
allActionPending: false,
|
||||
data: [],
|
||||
},
|
||||
};
|
||||
|
||||
case RUN_ALL_DEAD_TASKS_ERROR:
|
||||
case DELETE_ALL_DEAD_TASKS_ERROR:
|
||||
case RUN_ALL_ARCHIVED_TASKS_ERROR:
|
||||
case DELETE_ALL_ARCHIVED_TASKS_ERROR:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
allActionPending: false,
|
||||
},
|
||||
};
|
||||
|
||||
case BATCH_RUN_DEAD_TASKS_BEGIN:
|
||||
case BATCH_DELETE_DEAD_TASKS_BEGIN:
|
||||
case BATCH_RUN_ARCHIVED_TASKS_BEGIN:
|
||||
case BATCH_DELETE_ARCHIVED_TASKS_BEGIN:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
batchActionPending: true,
|
||||
data: state.deadTasks.data.map((task) => {
|
||||
data: state.archivedTasks.data.map((task) => {
|
||||
if (!action.taskKeys.includes(task.key)) {
|
||||
return task;
|
||||
}
|
||||
@ -935,42 +935,42 @@ function tasksReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case BATCH_RUN_DEAD_TASKS_SUCCESS: {
|
||||
const newData = state.deadTasks.data.filter(
|
||||
case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
|
||||
const newData = state.archivedTasks.data.filter(
|
||||
(task) => !action.payload.pending_keys.includes(task.key)
|
||||
);
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
batchActionPending: false,
|
||||
data: newData,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
case BATCH_DELETE_DEAD_TASKS_SUCCESS: {
|
||||
const newData = state.deadTasks.data.filter(
|
||||
case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
|
||||
const newData = state.archivedTasks.data.filter(
|
||||
(task) => !action.payload.deleted_keys.includes(task.key)
|
||||
);
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
batchActionPending: false,
|
||||
data: newData,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
case BATCH_RUN_DEAD_TASKS_ERROR:
|
||||
case BATCH_DELETE_DEAD_TASKS_ERROR:
|
||||
case BATCH_RUN_ARCHIVED_TASKS_ERROR:
|
||||
case BATCH_DELETE_ARCHIVED_TASKS_ERROR:
|
||||
return {
|
||||
...state,
|
||||
deadTasks: {
|
||||
...state.deadTasks,
|
||||
archivedTasks: {
|
||||
...state.archivedTasks,
|
||||
batchActionPending: false,
|
||||
data: state.deadTasks.data.map((task) => {
|
||||
data: state.archivedTasks.data.map((task) => {
|
||||
if (!action.taskKeys.includes(task.key)) {
|
||||
return task;
|
||||
}
|
||||
|
@ -155,8 +155,8 @@ function DashboardView(props: Props) {
|
||||
retried in the future
|
||||
</div>
|
||||
<div>
|
||||
<strong>Dead</strong>: number of tasks exhausted their
|
||||
retries
|
||||
<strong>Archived</strong>: number of tasks exhausted
|
||||
their retries
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ interface RouteParams {
|
||||
qname: string;
|
||||
}
|
||||
|
||||
const validStatus = ["active", "pending", "scheduled", "retry", "dead"];
|
||||
const validStatus = ["active", "pending", "scheduled", "retry", "archived"];
|
||||
const defaultStatus = "active";
|
||||
|
||||
function TasksView() {
|
||||
|
@ -1409,7 +1409,7 @@
|
||||
|
||||
"@material-ui/icons@4.9.1":
|
||||
version "4.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.9.1.tgz#fdeadf8cb3d89208945b33dbc50c7c616d0bd665"
|
||||
resolved "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.9.1.tgz#farchivedf8cb3d89208945b33dbc50c7c616d0bd665"
|
||||
integrity sha512-GBitL3oBWO0hzBhvA9KxqcowRUsA0qzwKkURyC8nppnC3fw54KPKZ+d4V1Eeg/UnDRSzDaI9nGCdel/eh9AQMg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.4.4"
|
||||
@ -7010,9 +7010,9 @@ jsx-ast-utils@^2.2.1, jsx-ast-utils@^2.2.3:
|
||||
array-includes "^3.0.3"
|
||||
object.assign "^4.1.0"
|
||||
|
||||
killable@^1.0.1:
|
||||
archiveable@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892"
|
||||
resolved "https://registry.yarnpkg.com/archiveable/-/archiveable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892"
|
||||
integrity sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==
|
||||
|
||||
kind-of@^2.0.1:
|
||||
@ -11459,7 +11459,7 @@ webpack-dev-server@3.11.0:
|
||||
internal-ip "^4.3.0"
|
||||
ip "^1.1.5"
|
||||
is-absolute-url "^3.0.3"
|
||||
killable "^1.0.1"
|
||||
archiveable "^1.0.1"
|
||||
loglevel "^1.6.8"
|
||||
opn "^5.5.0"
|
||||
p-retry "^3.0.1"
|
||||
|
Loading…
Reference in New Issue
Block a user