Rename DeadTask to ArchivedTask, and action Kill to Archive

This commit is contained in:
Ken Hibino 2021-01-12 11:59:44 -08:00
parent 95eb3e0855
commit 34b6553d7d
19 changed files with 1071 additions and 650 deletions

View File

@ -22,7 +22,7 @@ type QueueStateSnapshot struct {
Pending int `json:"pending"` Pending int `json:"pending"`
Scheduled int `json:"scheduled"` Scheduled int `json:"scheduled"`
Retry int `json:"retry"` Retry int `json:"retry"`
Dead int `json:"dead"` Archived int `json:"archived"`
// Total number of tasks processed during the given date. // Total number of tasks processed during the given date.
// The number includes both succeeded and failed tasks. // The number includes both succeeded and failed tasks.
@ -45,7 +45,7 @@ func toQueueStateSnapshot(s *asynq.QueueStats) *QueueStateSnapshot {
Pending: s.Pending, Pending: s.Pending,
Scheduled: s.Scheduled, Scheduled: s.Scheduled,
Retry: s.Retry, Retry: s.Retry,
Dead: s.Dead, Archived: s.Archived,
Processed: s.Processed, Processed: s.Processed,
Succeeded: s.Processed - s.Failed, Succeeded: s.Processed - s.Failed,
Failed: s.Failed, Failed: s.Failed,
@ -193,7 +193,7 @@ func toRetryTasks(in []*asynq.RetryTask) []*RetryTask {
return out return out
} }
type DeadTask struct { type ArchivedTask struct {
*BaseTask *BaseTask
Key string `json:"key"` Key string `json:"key"`
MaxRetry int `json:"max_retry"` MaxRetry int `json:"max_retry"`
@ -202,14 +202,14 @@ type DeadTask struct {
LastFailedAt time.Time `json:"last_failed_at"` LastFailedAt time.Time `json:"last_failed_at"`
} }
func toDeadTask(t *asynq.DeadTask) *DeadTask { func toArchivedTask(t *asynq.ArchivedTask) *ArchivedTask {
base := &BaseTask{ base := &BaseTask{
ID: t.ID, ID: t.ID,
Type: t.Type, Type: t.Type,
Payload: t.Payload, Payload: t.Payload,
Queue: t.Queue, Queue: t.Queue,
} }
return &DeadTask{ return &ArchivedTask{
BaseTask: base, BaseTask: base,
Key: t.Key(), Key: t.Key(),
MaxRetry: t.MaxRetry, MaxRetry: t.MaxRetry,
@ -219,10 +219,10 @@ func toDeadTask(t *asynq.DeadTask) *DeadTask {
} }
} }
func toDeadTasks(in []*asynq.DeadTask) []*DeadTask { func toArchivedTasks(in []*asynq.ArchivedTask) []*ArchivedTask {
out := make([]*DeadTask, len(in)) out := make([]*ArchivedTask, len(in))
for i, t := range in { for i, t := range in {
out[i] = toDeadTask(t) out[i] = toArchivedTask(t)
} }
return out return out
} }

26
main.go
View File

@ -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/{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:run_all", newRunAllScheduledTasksHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/scheduled_tasks:batch_run", newBatchRunTasksHandlerFunc(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/{task_key}:archive", newArchiveTaskHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/scheduled_tasks:kill_all", newKillAllScheduledTasksHandlerFunc(inspector)).Methods("POST") api.HandleFunc("/queues/{qname}/scheduled_tasks:archive_all", newArchiveAllScheduledTasksHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/scheduled_tasks:batch_kill", newBatchKillTasksHandlerFunc(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", newListRetryTasksHandlerFunc(inspector)).Methods("GET")
api.HandleFunc("/queues/{qname}/retry_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE") api.HandleFunc("/queues/{qname}/retry_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE")
api.HandleFunc("/queues/{qname}/retry_tasks:delete_all", newDeleteAllRetryTasksHandlerFunc(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/{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:run_all", newRunAllRetryTasksHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/retry_tasks:batch_run", newBatchRunTasksHandlerFunc(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/{task_key}:archive", newArchiveTaskHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/retry_tasks:kill_all", newKillAllRetryTasksHandlerFunc(inspector)).Methods("POST") api.HandleFunc("/queues/{qname}/retry_tasks:archive_all", newArchiveAllRetryTasksHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/retry_tasks:batch_kill", newBatchKillTasksHandlerFunc(inspector)).Methods("POST") api.HandleFunc("/queues/{qname}/retry_tasks:batch_archive", newBatchArchiveTasksHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/dead_tasks", newListDeadTasksHandlerFunc(inspector)).Methods("GET") api.HandleFunc("/queues/{qname}/archived_tasks", newListArchivedTasksHandlerFunc(inspector)).Methods("GET")
api.HandleFunc("/queues/{qname}/dead_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE") api.HandleFunc("/queues/{qname}/archived_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE")
api.HandleFunc("/queues/{qname}/dead_tasks:delete_all", newDeleteAllDeadTasksHandlerFunc(inspector)).Methods("DELETE") api.HandleFunc("/queues/{qname}/archived_tasks:delete_all", newDeleteAllArchivedTasksHandlerFunc(inspector)).Methods("DELETE")
api.HandleFunc("/queues/{qname}/dead_tasks:batch_delete", newBatchDeleteTasksHandlerFunc(inspector)).Methods("POST") api.HandleFunc("/queues/{qname}/archived_tasks:batch_delete", newBatchDeleteTasksHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/dead_tasks/{task_key}:run", newRunTaskHandlerFunc(inspector)).Methods("POST") api.HandleFunc("/queues/{qname}/archived_tasks/{task_key}:run", newRunTaskHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/dead_tasks:run_all", newRunAllDeadTasksHandlerFunc(inspector)).Methods("POST") api.HandleFunc("/queues/{qname}/archived_tasks:run_all", newRunAllArchivedTasksHandlerFunc(inspector)).Methods("POST")
api.HandleFunc("/queues/{qname}/dead_tasks:batch_run", newBatchRunTasksHandlerFunc(inspector)).Methods("POST") api.HandleFunc("/queues/{qname}/archived_tasks:batch_run", newBatchRunTasksHandlerFunc(inspector)).Methods("POST")
// Servers endpoints. // Servers endpoints.
api.HandleFunc("/servers", newListServersHandlerFunc(inspector)).Methods("GET") api.HandleFunc("/servers", newListServersHandlerFunc(inspector)).Methods("GET")

View File

@ -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) { return func(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r) vars := mux.Vars(r)
qname := vars["qname"] qname := vars["qname"]
pageSize, pageNum := getPageOptions(r) pageSize, pageNum := getPageOptions(r)
tasks, err := inspector.ListDeadTasks( tasks, err := inspector.ListArchivedTasks(
qname, asynq.PageSize(pageSize), asynq.Page(pageNum)) qname, asynq.PageSize(pageSize), asynq.Page(pageNum))
if err != nil { if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
@ -236,9 +236,9 @@ func newListDeadTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
payload := make(map[string]interface{}) payload := make(map[string]interface{})
if len(tasks) == 0 { if len(tasks) == 0 {
// avoid nil for the tasks field in json output. // avoid nil for the tasks field in json output.
payload["tasks"] = make([]*DeadTask, 0) payload["tasks"] = make([]*ArchivedTask, 0)
} else { } else {
payload["tasks"] = toDeadTasks(tasks) payload["tasks"] = toArchivedTasks(tasks)
} }
payload["stats"] = toQueueStateSnapshot(stats) payload["stats"] = toQueueStateSnapshot(stats)
if err := json.NewEncoder(w).Encode(payload); err != nil { 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) { return func(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r) vars := mux.Vars(r)
qname, key := vars["qname"], vars["task_key"] 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) http.Error(w, "route parameters should not be empty", http.StatusBadRequest)
return 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 // TODO: Handle task not found error and return 404
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
return 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) { return func(w http.ResponseWriter, r *http.Request) {
qname := mux.Vars(r)["qname"] 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) http.Error(w, err.Error(), http.StatusInternalServerError)
return 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) { return func(w http.ResponseWriter, r *http.Request) {
qname := mux.Vars(r)["qname"] 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) http.Error(w, err.Error(), http.StatusInternalServerError)
return 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) { return func(w http.ResponseWriter, r *http.Request) {
qname := mux.Vars(r)["qname"] 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) http.Error(w, err.Error(), http.StatusInternalServerError)
return 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) { return func(w http.ResponseWriter, r *http.Request) {
qname := mux.Vars(r)["qname"] 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) http.Error(w, err.Error(), http.StatusInternalServerError)
return return
} }
@ -485,41 +485,41 @@ func newBatchRunTasksHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
} }
} }
type batchKillTasksRequest struct { type batchArchiveTasksRequest struct {
TaskKeys []string `json:"task_keys"` TaskKeys []string `json:"task_keys"`
} }
type batchKillTasksResponse struct { type batchArchiveTasksResponse struct {
// task keys that were successfully moved to the dead state. // task keys that were successfully moved to the archived state.
DeadKeys []string `json:"dead_keys"` ArchivedKeys []string `json:"archived_keys"`
// task keys that were not able to move to the dead state. // task keys that were not able to move to the archived state.
ErrorKeys []string `json:"error_keys"` 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) { return func(w http.ResponseWriter, r *http.Request) {
r.Body = http.MaxBytesReader(w, r.Body, maxRequestBodySize) r.Body = http.MaxBytesReader(w, r.Body, maxRequestBodySize)
dec := json.NewDecoder(r.Body) dec := json.NewDecoder(r.Body)
dec.DisallowUnknownFields() dec.DisallowUnknownFields()
var req batchKillTasksRequest var req batchArchiveTasksRequest
if err := dec.Decode(&req); err != nil { if err := dec.Decode(&req); err != nil {
http.Error(w, err.Error(), http.StatusBadRequest) http.Error(w, err.Error(), http.StatusBadRequest)
return return
} }
qname := mux.Vars(r)["qname"] qname := mux.Vars(r)["qname"]
resp := batchKillTasksResponse{ resp := batchArchiveTasksResponse{
// avoid null in the json response // avoid null in the json response
DeadKeys: make([]string, 0), ArchivedKeys: make([]string, 0),
ErrorKeys: make([]string, 0), ErrorKeys: make([]string, 0),
} }
for _, key := range req.TaskKeys { for _, key := range req.TaskKeys {
if err := inspector.KillTaskByKey(qname, key); err != nil { if err := inspector.ArchiveTaskByKey(qname, key); err != nil {
log.Printf("error: could not kill task with key %q: %v", key, err) log.Printf("error: could not archive task with key %q: %v", key, err)
resp.ErrorKeys = append(resp.ErrorKeys, key) resp.ErrorKeys = append(resp.ErrorKeys, key)
} else { } else {
resp.DeadKeys = append(resp.DeadKeys, key) resp.ArchivedKeys = append(resp.ArchivedKeys, key)
} }
} }
if err := json.NewEncoder(w).Encode(resp); err != nil { if err := json.NewEncoder(w).Encode(resp); err != nil {

View File

@ -46,7 +46,7 @@
"browserslist": { "browserslist": {
"production": [ "production": [
">0.2%", ">0.2%",
"not dead", "not archived",
"not op_mini all" "not op_mini all"
], ],
"development": [ "development": [

View File

@ -1,33 +1,33 @@
import { import {
batchCancelActiveTasks, batchCancelActiveTasks,
BatchCancelTasksResponse, BatchCancelTasksResponse,
batchDeleteDeadTasks, batchDeleteArchivedTasks,
batchDeleteRetryTasks, batchDeleteRetryTasks,
batchDeleteScheduledTasks, batchDeleteScheduledTasks,
BatchDeleteTasksResponse, BatchDeleteTasksResponse,
batchKillRetryTasks, batchArchiveRetryTasks,
batchKillScheduledTasks, batchArchiveScheduledTasks,
BatchKillTasksResponse, BatchArchiveTasksResponse,
batchRunDeadTasks, batchRunArchivedTasks,
batchRunRetryTasks, batchRunRetryTasks,
batchRunScheduledTasks, batchRunScheduledTasks,
BatchRunTasksResponse, BatchRunTasksResponse,
cancelActiveTask, cancelActiveTask,
cancelAllActiveTasks, cancelAllActiveTasks,
deleteAllDeadTasks, deleteAllArchivedTasks,
deleteAllRetryTasks, deleteAllRetryTasks,
deleteAllScheduledTasks, deleteAllScheduledTasks,
deleteDeadTask, deleteArchivedTask,
deleteRetryTask, deleteRetryTask,
deleteScheduledTask, deleteScheduledTask,
killAllRetryTasks, archiveAllRetryTasks,
killAllScheduledTasks, archiveAllScheduledTasks,
killRetryTask, archiveRetryTask,
killScheduledTask, archiveScheduledTask,
listActiveTasks, listActiveTasks,
ListActiveTasksResponse, ListActiveTasksResponse,
listDeadTasks, listArchivedTasks,
ListDeadTasksResponse, ListArchivedTasksResponse,
listPendingTasks, listPendingTasks,
ListPendingTasksResponse, ListPendingTasksResponse,
listRetryTasks, listRetryTasks,
@ -35,10 +35,10 @@ import {
listScheduledTasks, listScheduledTasks,
ListScheduledTasksResponse, ListScheduledTasksResponse,
PaginationOptions, PaginationOptions,
runAllDeadTasks, runAllArchivedTasks,
runAllRetryTasks, runAllRetryTasks,
runAllScheduledTasks, runAllScheduledTasks,
runDeadTask, runArchivedTask,
runRetryTask, runRetryTask,
runScheduledTask, runScheduledTask,
} from "../api"; } 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_BEGIN = "LIST_RETRY_TASKS_BEGIN";
export const LIST_RETRY_TASKS_SUCCESS = "LIST_RETRY_TASKS_SUCCESS"; export const LIST_RETRY_TASKS_SUCCESS = "LIST_RETRY_TASKS_SUCCESS";
export const LIST_RETRY_TASKS_ERROR = "LIST_RETRY_TASKS_ERROR"; export const LIST_RETRY_TASKS_ERROR = "LIST_RETRY_TASKS_ERROR";
export const LIST_DEAD_TASKS_BEGIN = "LIST_DEAD_TASKS_BEGIN"; export const LIST_ARCHIVED_TASKS_BEGIN = "LIST_ARCHIVED_TASKS_BEGIN";
export const LIST_DEAD_TASKS_SUCCESS = "LIST_DEAD_TASKS_SUCCESS"; export const LIST_ARCHIVED_TASKS_SUCCESS = "LIST_ARCHIVED_TASKS_SUCCESS";
export const LIST_DEAD_TASKS_ERROR = "LIST_DEAD_TASKS_ERROR"; 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_BEGIN = "CANCEL_ACTIVE_TASK_BEGIN";
export const CANCEL_ACTIVE_TASK_SUCCESS = "CANCEL_ACTIVE_TASK_SUCCESS"; export const CANCEL_ACTIVE_TASK_SUCCESS = "CANCEL_ACTIVE_TASK_SUCCESS";
export const CANCEL_ACTIVE_TASK_ERROR = "CANCEL_ACTIVE_TASK_ERROR"; 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"; "BATCH_CANCEL_ACTIVE_TASKS_SUCCESS";
export const BATCH_CANCEL_ACTIVE_TASKS_ERROR = export const BATCH_CANCEL_ACTIVE_TASKS_ERROR =
"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_BEGIN = "RUN_ARCHIVED_TASK_BEGIN";
export const RUN_SCHEDULED_TASK_SUCCESS = "RUN_DEAD_TASK_SUCCESS"; export const RUN_SCHEDULED_TASK_SUCCESS = "RUN_ARCHIVED_TASK_SUCCESS";
export const RUN_SCHEDULED_TASK_ERROR = "RUN_DEAD_TASK_ERROR"; 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_BEGIN = "RUN_RETRY_TASK_BEGIN";
export const RUN_RETRY_TASK_SUCCESS = "RUN_RETRY_TASK_SUCCESS"; export const RUN_RETRY_TASK_SUCCESS = "RUN_RETRY_TASK_SUCCESS";
export const RUN_RETRY_TASK_ERROR = "RUN_RETRY_TASK_ERROR"; export const RUN_RETRY_TASK_ERROR = "RUN_RETRY_TASK_ERROR";
export const RUN_DEAD_TASK_BEGIN = "RUN_DEAD_TASK_BEGIN"; export const RUN_ARCHIVED_TASK_BEGIN = "RUN_ARCHIVED_TASK_BEGIN";
export const RUN_DEAD_TASK_SUCCESS = "RUN_DEAD_TASK_SUCCESS"; export const RUN_ARCHIVED_TASK_SUCCESS = "RUN_ARCHIVED_TASK_SUCCESS";
export const RUN_DEAD_TASK_ERROR = "RUN_DEAD_TASK_ERROR"; 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_BEGIN = "DELETE_SCHEDULED_TASK_BEGIN";
export const DELETE_SCHEDULED_TASK_SUCCESS = "DELETE_SCHEDULED_TASK_SUCCESS"; export const DELETE_SCHEDULED_TASK_SUCCESS = "DELETE_SCHEDULED_TASK_SUCCESS";
export const DELETE_SCHEDULED_TASK_ERROR = "DELETE_SCHEDULED_TASK_ERROR"; export const DELETE_SCHEDULED_TASK_ERROR = "DELETE_SCHEDULED_TASK_ERROR";
export const KILL_SCHEDULED_TASK_BEGIN = "KILL_DEAD_TASK_BEGIN"; export const ARCHIVE_SCHEDULED_TASK_BEGIN = "ARCHIVE_ARCHIVED_TASK_BEGIN";
export const KILL_SCHEDULED_TASK_SUCCESS = "KILL_DEAD_TASK_SUCCESS"; export const ARCHIVE_SCHEDULED_TASK_SUCCESS = "ARCHIVE_ARCHIVED_TASK_SUCCESS";
export const KILL_SCHEDULED_TASK_ERROR = "KILL_DEAD_TASK_ERROR"; export const ARCHIVE_SCHEDULED_TASK_ERROR = "ARCHIVE_ARCHIVED_TASK_ERROR";
export const KILL_RETRY_TASK_BEGIN = "KILL_RETRY_TASK_BEGIN"; export const ARCHIVE_RETRY_TASK_BEGIN = "ARCHIVE_RETRY_TASK_BEGIN";
export const KILL_RETRY_TASK_SUCCESS = "KILL_RETRY_TASK_SUCCESS"; export const ARCHIVE_RETRY_TASK_SUCCESS = "ARCHIVE_RETRY_TASK_SUCCESS";
export const KILL_RETRY_TASK_ERROR = "KILL_RETRY_TASK_ERROR"; export const ARCHIVE_RETRY_TASK_ERROR = "ARCHIVE_RETRY_TASK_ERROR";
export const BATCH_RUN_SCHEDULED_TASKS_BEGIN = export const BATCH_RUN_SCHEDULED_TASKS_BEGIN =
"BATCH_RUN_SCHEDULED_TASKS_BEGIN"; "BATCH_RUN_SCHEDULED_TASKS_BEGIN";
export const BATCH_RUN_SCHEDULED_TASKS_SUCCESS = export const BATCH_RUN_SCHEDULED_TASKS_SUCCESS =
"BATCH_RUN_SCHEDULED_TASKS_SUCCESS"; "BATCH_RUN_SCHEDULED_TASKS_SUCCESS";
export const BATCH_RUN_SCHEDULED_TASKS_ERROR = export const BATCH_RUN_SCHEDULED_TASKS_ERROR =
"BATCH_RUN_SCHEDULED_TASKS_ERROR"; "BATCH_RUN_SCHEDULED_TASKS_ERROR";
export const BATCH_KILL_SCHEDULED_TASKS_BEGIN = export const BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN =
"BATCH_KILL_SCHEDULED_TASKS_BEGIN"; "BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN";
export const BATCH_KILL_SCHEDULED_TASKS_SUCCESS = export const BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS =
"BATCH_KILL_SCHEDULED_TASKS_SUCCESS"; "BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS";
export const BATCH_KILL_SCHEDULED_TASKS_ERROR = export const BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR =
"BATCH_RUN_SCHEDULED_TASKS_ERROR"; "BATCH_RUN_SCHEDULED_TASKS_ERROR";
export const BATCH_DELETE_SCHEDULED_TASKS_BEGIN = export const BATCH_DELETE_SCHEDULED_TASKS_BEGIN =
"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 = export const RUN_ALL_SCHEDULED_TASKS_SUCCESS =
"RUN_ALL_SCHEDULED_TASKS_SUCCESS"; "RUN_ALL_SCHEDULED_TASKS_SUCCESS";
export const RUN_ALL_SCHEDULED_TASKS_ERROR = "RUN_ALL_SCHEDULED_TASKS_ERROR"; 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 ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN =
export const KILL_ALL_SCHEDULED_TASKS_SUCCESS = "ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN";
"KILL_ALL_SCHEDULED_TASKS_SUCCESS"; export const ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS =
export const KILL_ALL_SCHEDULED_TASKS_ERROR = "KILL_ALL_SCHEDULED_TASKS_ERROR"; "ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS";
export const ARCHIVE_ALL_SCHEDULED_TASKS_ERROR =
"ARCHIVE_ALL_SCHEDULED_TASKS_ERROR";
export const DELETE_ALL_SCHEDULED_TASKS_BEGIN = export const DELETE_ALL_SCHEDULED_TASKS_BEGIN =
"DELETE_ALL_SCHEDULED_TASKS_BEGIN"; "DELETE_ALL_SCHEDULED_TASKS_BEGIN";
export const DELETE_ALL_SCHEDULED_TASKS_SUCCESS = 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_BEGIN = "BATCH_RUN_RETRY_TASKS_BEGIN";
export const BATCH_RUN_RETRY_TASKS_SUCCESS = "BATCH_RUN_RETRY_TASKS_SUCCESS"; 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_RUN_RETRY_TASKS_ERROR = "BATCH_RUN_RETRY_TASKS_ERROR";
export const BATCH_KILL_RETRY_TASKS_BEGIN = "BATCH_KILL_RETRY_TASKS_BEGIN"; export const BATCH_ARCHIVE_RETRY_TASKS_BEGIN =
export const BATCH_KILL_RETRY_TASKS_SUCCESS = "BATCH_KILL_RETRY_TASKS_SUCCESS"; "BATCH_ARCHIVE_RETRY_TASKS_BEGIN";
export const BATCH_KILL_RETRY_TASKS_ERROR = "BATCH_KILL_RETRY_TASKS_ERROR"; 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_BEGIN = "BATCH_DELETE_RETRY_TASKS_BEGIN";
export const BATCH_DELETE_RETRY_TASKS_SUCCESS = export const BATCH_DELETE_RETRY_TASKS_SUCCESS =
"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_BEGIN = "RUN_ALL_RETRY_TASKS_BEGIN";
export const RUN_ALL_RETRY_TASKS_SUCCESS = "RUN_ALL_RETRY_TASKS_SUCCESS"; 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 RUN_ALL_RETRY_TASKS_ERROR = "RUN_ALL_RETRY_TASKS_ERROR";
export const KILL_ALL_RETRY_TASKS_BEGIN = "KILL_ALL_RETRY_TASKS_BEGIN"; export const ARCHIVE_ALL_RETRY_TASKS_BEGIN = "ARCHIVE_ALL_RETRY_TASKS_BEGIN";
export const KILL_ALL_RETRY_TASKS_SUCCESS = "KILL_ALL_RETRY_TASKS_SUCCESS"; export const ARCHIVE_ALL_RETRY_TASKS_SUCCESS =
export const KILL_ALL_RETRY_TASKS_ERROR = "KILL_ALL_RETRY_TASKS_ERROR"; "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_BEGIN = "DELETE_ALL_RETRY_TASKS_BEGIN";
export const DELETE_ALL_RETRY_TASKS_SUCCESS = "DELETE_ALL_RETRY_TASKS_SUCCESS"; 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_ALL_RETRY_TASKS_ERROR = "DELETE_ALL_RETRY_TASKS_ERROR";
export const DELETE_DEAD_TASK_BEGIN = "DELETE_DEAD_TASK_BEGIN"; export const DELETE_ARCHIVED_TASK_BEGIN = "DELETE_ARCHIVED_TASK_BEGIN";
export const DELETE_DEAD_TASK_SUCCESS = "DELETE_DEAD_TASK_SUCCESS"; export const DELETE_ARCHIVED_TASK_SUCCESS = "DELETE_ARCHIVED_TASK_SUCCESS";
export const DELETE_DEAD_TASK_ERROR = "DELETE_DEAD_TASK_ERROR"; export const DELETE_ARCHIVED_TASK_ERROR = "DELETE_ARCHIVED_TASK_ERROR";
export const BATCH_RUN_DEAD_TASKS_BEGIN = "BATCH_RUN_DEAD_TASKS_BEGIN"; export const BATCH_RUN_ARCHIVED_TASKS_BEGIN = "BATCH_RUN_ARCHIVED_TASKS_BEGIN";
export const BATCH_RUN_DEAD_TASKS_SUCCESS = "BATCH_RUN_DEAD_TASKS_SUCCESS"; export const BATCH_RUN_ARCHIVED_TASKS_SUCCESS =
export const BATCH_RUN_DEAD_TASKS_ERROR = "BATCH_RUN_DEAD_TASKS_ERROR"; "BATCH_RUN_ARCHIVED_TASKS_SUCCESS";
export const BATCH_DELETE_DEAD_TASKS_BEGIN = "BATCH_DELETE_DEAD_TASKS_BEGIN"; export const BATCH_RUN_ARCHIVED_TASKS_ERROR = "BATCH_RUN_ARCHIVED_TASKS_ERROR";
export const BATCH_DELETE_DEAD_TASKS_SUCCESS = export const BATCH_DELETE_ARCHIVED_TASKS_BEGIN =
"BATCH_DELETE_DEAD_TASKS_SUCCESS"; "BATCH_DELETE_ARCHIVED_TASKS_BEGIN";
export const BATCH_DELETE_DEAD_TASKS_ERROR = "BATCH_DELETE_DEAD_TASKS_ERROR"; export const BATCH_DELETE_ARCHIVED_TASKS_SUCCESS =
export const RUN_ALL_DEAD_TASKS_BEGIN = "RUN_ALL_DEAD_TASKS_BEGIN"; "BATCH_DELETE_ARCHIVED_TASKS_SUCCESS";
export const RUN_ALL_DEAD_TASKS_SUCCESS = "RUN_ALL_DEAD_TASKS_SUCCESS"; export const BATCH_DELETE_ARCHIVED_TASKS_ERROR =
export const RUN_ALL_DEAD_TASKS_ERROR = "RUN_ALL_DEAD_TASKS_ERROR"; "BATCH_DELETE_ARCHIVED_TASKS_ERROR";
export const DELETE_ALL_DEAD_TASKS_BEGIN = "DELETE_ALL_DEAD_TASKS_BEGIN"; export const RUN_ALL_ARCHIVED_TASKS_BEGIN = "RUN_ALL_ARCHIVED_TASKS_BEGIN";
export const DELETE_ALL_DEAD_TASKS_SUCCESS = "DELETE_ALL_DEAD_TASKS_SUCCESS"; export const RUN_ALL_ARCHIVED_TASKS_SUCCESS = "RUN_ALL_ARCHIVED_TASKS_SUCCESS";
export const DELETE_ALL_DEAD_TASKS_ERROR = "DELETE_ALL_DEAD_TASKS_ERROR"; 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 { interface ListActiveTasksBeginAction {
type: typeof LIST_ACTIVE_TASKS_BEGIN; type: typeof LIST_ACTIVE_TASKS_BEGIN;
@ -230,19 +242,19 @@ interface ListRetryTasksErrorAction {
error: string; // error description error: string; // error description
} }
interface ListDeadTasksBeginAction { interface ListArchivedTasksBeginAction {
type: typeof LIST_DEAD_TASKS_BEGIN; type: typeof LIST_ARCHIVED_TASKS_BEGIN;
queue: string; queue: string;
} }
interface ListDeadTasksSuccessAction { interface ListArchivedTasksSuccessAction {
type: typeof LIST_DEAD_TASKS_SUCCESS; type: typeof LIST_ARCHIVED_TASKS_SUCCESS;
queue: string; queue: string;
payload: ListDeadTasksResponse; payload: ListArchivedTasksResponse;
} }
interface ListDeadTasksErrorAction { interface ListArchivedTasksErrorAction {
type: typeof LIST_DEAD_TASKS_ERROR; type: typeof LIST_ARCHIVED_TASKS_ERROR;
queue: string; queue: string;
error: string; // error description error: string; // error description
} }
@ -320,20 +332,20 @@ interface RunScheduledTaskErrorAction {
error: string; error: string;
} }
interface KillScheduledTaskBeginAction { interface ArchiveScheduledTaskBeginAction {
type: typeof KILL_SCHEDULED_TASK_BEGIN; type: typeof ARCHIVE_SCHEDULED_TASK_BEGIN;
queue: string; queue: string;
taskKey: string; taskKey: string;
} }
interface KillScheduledTaskSuccessAction { interface ArchiveScheduledTaskSuccessAction {
type: typeof KILL_SCHEDULED_TASK_SUCCESS; type: typeof ARCHIVE_SCHEDULED_TASK_SUCCESS;
queue: string; queue: string;
taskKey: string; taskKey: string;
} }
interface KillScheduledTaskErrorAction { interface ArchiveScheduledTaskErrorAction {
type: typeof KILL_SCHEDULED_TASK_ERROR; type: typeof ARCHIVE_SCHEDULED_TASK_ERROR;
queue: string; queue: string;
taskKey: string; taskKey: string;
error: string; error: string;
@ -358,39 +370,39 @@ interface RunRetryTaskErrorAction {
error: string; error: string;
} }
interface KillRetryTaskBeginAction { interface ArchiveRetryTaskBeginAction {
type: typeof KILL_RETRY_TASK_BEGIN; type: typeof ARCHIVE_RETRY_TASK_BEGIN;
queue: string; queue: string;
taskKey: string; taskKey: string;
} }
interface KillRetryTaskSuccessAction { interface ArchiveRetryTaskSuccessAction {
type: typeof KILL_RETRY_TASK_SUCCESS; type: typeof ARCHIVE_RETRY_TASK_SUCCESS;
queue: string; queue: string;
taskKey: string; taskKey: string;
} }
interface KillRetryTaskErrorAction { interface ArchiveRetryTaskErrorAction {
type: typeof KILL_RETRY_TASK_ERROR; type: typeof ARCHIVE_RETRY_TASK_ERROR;
queue: string; queue: string;
taskKey: string; taskKey: string;
error: string; error: string;
} }
interface RunDeadTaskBeginAction { interface RunArchivedTaskBeginAction {
type: typeof RUN_DEAD_TASK_BEGIN; type: typeof RUN_ARCHIVED_TASK_BEGIN;
queue: string; queue: string;
taskKey: string; taskKey: string;
} }
interface RunDeadTaskSuccessAction { interface RunArchivedTaskSuccessAction {
type: typeof RUN_DEAD_TASK_SUCCESS; type: typeof RUN_ARCHIVED_TASK_SUCCESS;
queue: string; queue: string;
taskKey: string; taskKey: string;
} }
interface RunDeadTaskErrorAction { interface RunArchivedTaskErrorAction {
type: typeof RUN_DEAD_TASK_ERROR; type: typeof RUN_ARCHIVED_TASK_ERROR;
queue: string; queue: string;
taskKey: string; taskKey: string;
error: string; error: string;
@ -469,37 +481,37 @@ interface RunAllScheduledTasksErrorAction {
error: string; error: string;
} }
interface BatchKillScheduledTasksBeginAction { interface BatchArchiveScheduledTasksBeginAction {
type: typeof BATCH_KILL_SCHEDULED_TASKS_BEGIN; type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN;
queue: string; queue: string;
taskKeys: string[]; taskKeys: string[];
} }
interface BatchKillScheduledTasksSuccessAction { interface BatchArchiveScheduledTasksSuccessAction {
type: typeof BATCH_KILL_SCHEDULED_TASKS_SUCCESS; type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS;
queue: string; queue: string;
payload: BatchKillTasksResponse; payload: BatchArchiveTasksResponse;
} }
interface BatchKillScheduledTasksErrorAction { interface BatchArchiveScheduledTasksErrorAction {
type: typeof BATCH_KILL_SCHEDULED_TASKS_ERROR; type: typeof BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR;
queue: string; queue: string;
taskKeys: string[]; taskKeys: string[];
error: string; error: string;
} }
interface KillAllScheduledTasksBeginAction { interface ArchiveAllScheduledTasksBeginAction {
type: typeof KILL_ALL_SCHEDULED_TASKS_BEGIN; type: typeof ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN;
queue: string; queue: string;
} }
interface KillAllScheduledTasksSuccessAction { interface ArchiveAllScheduledTasksSuccessAction {
type: typeof KILL_ALL_SCHEDULED_TASKS_SUCCESS; type: typeof ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS;
queue: string; queue: string;
} }
interface KillAllScheduledTasksErrorAction { interface ArchiveAllScheduledTasksErrorAction {
type: typeof KILL_ALL_SCHEDULED_TASKS_ERROR; type: typeof ARCHIVE_ALL_SCHEDULED_TASKS_ERROR;
queue: string; queue: string;
error: string; error: string;
} }
@ -593,37 +605,37 @@ interface RunAllRetryTasksErrorAction {
error: string; error: string;
} }
interface BatchKillRetryTasksBeginAction { interface BatchArchiveRetryTasksBeginAction {
type: typeof BATCH_KILL_RETRY_TASKS_BEGIN; type: typeof BATCH_ARCHIVE_RETRY_TASKS_BEGIN;
queue: string; queue: string;
taskKeys: string[]; taskKeys: string[];
} }
interface BatchKillRetryTasksSuccessAction { interface BatchArchiveRetryTasksSuccessAction {
type: typeof BATCH_KILL_RETRY_TASKS_SUCCESS; type: typeof BATCH_ARCHIVE_RETRY_TASKS_SUCCESS;
queue: string; queue: string;
payload: BatchKillTasksResponse; payload: BatchArchiveTasksResponse;
} }
interface BatchKillRetryTasksErrorAction { interface BatchArchiveRetryTasksErrorAction {
type: typeof BATCH_KILL_RETRY_TASKS_ERROR; type: typeof BATCH_ARCHIVE_RETRY_TASKS_ERROR;
queue: string; queue: string;
taskKeys: string[]; taskKeys: string[];
error: string; error: string;
} }
interface KillAllRetryTasksBeginAction { interface ArchiveAllRetryTasksBeginAction {
type: typeof KILL_ALL_RETRY_TASKS_BEGIN; type: typeof ARCHIVE_ALL_RETRY_TASKS_BEGIN;
queue: string; queue: string;
} }
interface KillAllRetryTasksSuccessAction { interface ArchiveAllRetryTasksSuccessAction {
type: typeof KILL_ALL_RETRY_TASKS_SUCCESS; type: typeof ARCHIVE_ALL_RETRY_TASKS_SUCCESS;
queue: string; queue: string;
} }
interface KillAllRetryTasksErrorAction { interface ArchiveAllRetryTasksErrorAction {
type: typeof KILL_ALL_RETRY_TASKS_ERROR; type: typeof ARCHIVE_ALL_RETRY_TASKS_ERROR;
queue: string; queue: string;
error: string; error: string;
} }
@ -644,91 +656,91 @@ interface DeleteAllRetryTasksErrorAction {
error: string; error: string;
} }
interface DeleteDeadTaskBeginAction { interface DeleteArchivedTaskBeginAction {
type: typeof DELETE_DEAD_TASK_BEGIN; type: typeof DELETE_ARCHIVED_TASK_BEGIN;
queue: string; queue: string;
taskKey: string; taskKey: string;
} }
interface DeleteDeadTaskSuccessAction { interface DeleteArchivedTaskSuccessAction {
type: typeof DELETE_DEAD_TASK_SUCCESS; type: typeof DELETE_ARCHIVED_TASK_SUCCESS;
queue: string; queue: string;
taskKey: string; taskKey: string;
} }
interface DeleteDeadTaskErrorAction { interface DeleteArchivedTaskErrorAction {
type: typeof DELETE_DEAD_TASK_ERROR; type: typeof DELETE_ARCHIVED_TASK_ERROR;
queue: string; queue: string;
taskKey: string; taskKey: string;
error: string; error: string;
} }
interface BatchDeleteDeadTasksBeginAction { interface BatchDeleteArchivedTasksBeginAction {
type: typeof BATCH_DELETE_DEAD_TASKS_BEGIN; type: typeof BATCH_DELETE_ARCHIVED_TASKS_BEGIN;
queue: string; queue: string;
taskKeys: string[]; taskKeys: string[];
} }
interface BatchDeleteDeadTasksSuccessAction { interface BatchDeleteArchivedTasksSuccessAction {
type: typeof BATCH_DELETE_DEAD_TASKS_SUCCESS; type: typeof BATCH_DELETE_ARCHIVED_TASKS_SUCCESS;
queue: string; queue: string;
payload: BatchDeleteTasksResponse; payload: BatchDeleteTasksResponse;
} }
interface BatchDeleteDeadTasksErrorAction { interface BatchDeleteArchivedTasksErrorAction {
type: typeof BATCH_DELETE_DEAD_TASKS_ERROR; type: typeof BATCH_DELETE_ARCHIVED_TASKS_ERROR;
queue: string; queue: string;
taskKeys: string[]; taskKeys: string[];
error: string; error: string;
} }
interface BatchRunDeadTasksBeginAction { interface BatchRunArchivedTasksBeginAction {
type: typeof BATCH_RUN_DEAD_TASKS_BEGIN; type: typeof BATCH_RUN_ARCHIVED_TASKS_BEGIN;
queue: string; queue: string;
taskKeys: string[]; taskKeys: string[];
} }
interface BatchRunDeadTasksSuccessAction { interface BatchRunArchivedTasksSuccessAction {
type: typeof BATCH_RUN_DEAD_TASKS_SUCCESS; type: typeof BATCH_RUN_ARCHIVED_TASKS_SUCCESS;
queue: string; queue: string;
payload: BatchRunTasksResponse; payload: BatchRunTasksResponse;
} }
interface BatchRunDeadTasksErrorAction { interface BatchRunArchivedTasksErrorAction {
type: typeof BATCH_RUN_DEAD_TASKS_ERROR; type: typeof BATCH_RUN_ARCHIVED_TASKS_ERROR;
queue: string; queue: string;
taskKeys: string[]; taskKeys: string[];
error: string; error: string;
} }
interface RunAllDeadTasksBeginAction { interface RunAllArchivedTasksBeginAction {
type: typeof RUN_ALL_DEAD_TASKS_BEGIN; type: typeof RUN_ALL_ARCHIVED_TASKS_BEGIN;
queue: string; queue: string;
} }
interface RunAllDeadTasksSuccessAction { interface RunAllArchivedTasksSuccessAction {
type: typeof RUN_ALL_DEAD_TASKS_SUCCESS; type: typeof RUN_ALL_ARCHIVED_TASKS_SUCCESS;
queue: string; queue: string;
} }
interface RunAllDeadTasksErrorAction { interface RunAllArchivedTasksErrorAction {
type: typeof RUN_ALL_DEAD_TASKS_ERROR; type: typeof RUN_ALL_ARCHIVED_TASKS_ERROR;
queue: string; queue: string;
error: string; error: string;
} }
interface DeleteAllDeadTasksBeginAction { interface DeleteAllArchivedTasksBeginAction {
type: typeof DELETE_ALL_DEAD_TASKS_BEGIN; type: typeof DELETE_ALL_ARCHIVED_TASKS_BEGIN;
queue: string; queue: string;
} }
interface DeleteAllDeadTasksSuccessAction { interface DeleteAllArchivedTasksSuccessAction {
type: typeof DELETE_ALL_DEAD_TASKS_SUCCESS; type: typeof DELETE_ALL_ARCHIVED_TASKS_SUCCESS;
queue: string; queue: string;
} }
interface DeleteAllDeadTasksErrorAction { interface DeleteAllArchivedTasksErrorAction {
type: typeof DELETE_ALL_DEAD_TASKS_ERROR; type: typeof DELETE_ALL_ARCHIVED_TASKS_ERROR;
queue: string; queue: string;
error: string; error: string;
} }
@ -747,9 +759,9 @@ export type TasksActionTypes =
| ListRetryTasksBeginAction | ListRetryTasksBeginAction
| ListRetryTasksSuccessAction | ListRetryTasksSuccessAction
| ListRetryTasksErrorAction | ListRetryTasksErrorAction
| ListDeadTasksBeginAction | ListArchivedTasksBeginAction
| ListDeadTasksSuccessAction | ListArchivedTasksSuccessAction
| ListDeadTasksErrorAction | ListArchivedTasksErrorAction
| CancelActiveTaskBeginAction | CancelActiveTaskBeginAction
| CancelActiveTaskSuccessAction | CancelActiveTaskSuccessAction
| CancelActiveTaskErrorAction | CancelActiveTaskErrorAction
@ -765,15 +777,15 @@ export type TasksActionTypes =
| RunRetryTaskBeginAction | RunRetryTaskBeginAction
| RunRetryTaskSuccessAction | RunRetryTaskSuccessAction
| RunRetryTaskErrorAction | RunRetryTaskErrorAction
| RunDeadTaskBeginAction | RunArchivedTaskBeginAction
| RunDeadTaskSuccessAction | RunArchivedTaskSuccessAction
| RunDeadTaskErrorAction | RunArchivedTaskErrorAction
| KillScheduledTaskBeginAction | ArchiveScheduledTaskBeginAction
| KillScheduledTaskSuccessAction | ArchiveScheduledTaskSuccessAction
| KillScheduledTaskErrorAction | ArchiveScheduledTaskErrorAction
| KillRetryTaskBeginAction | ArchiveRetryTaskBeginAction
| KillRetryTaskSuccessAction | ArchiveRetryTaskSuccessAction
| KillRetryTaskErrorAction | ArchiveRetryTaskErrorAction
| DeleteScheduledTaskBeginAction | DeleteScheduledTaskBeginAction
| DeleteScheduledTaskSuccessAction | DeleteScheduledTaskSuccessAction
| DeleteScheduledTaskErrorAction | DeleteScheduledTaskErrorAction
@ -786,12 +798,12 @@ export type TasksActionTypes =
| RunAllScheduledTasksBeginAction | RunAllScheduledTasksBeginAction
| RunAllScheduledTasksSuccessAction | RunAllScheduledTasksSuccessAction
| RunAllScheduledTasksErrorAction | RunAllScheduledTasksErrorAction
| BatchKillScheduledTasksBeginAction | BatchArchiveScheduledTasksBeginAction
| BatchKillScheduledTasksSuccessAction | BatchArchiveScheduledTasksSuccessAction
| BatchKillScheduledTasksErrorAction | BatchArchiveScheduledTasksErrorAction
| KillAllScheduledTasksBeginAction | ArchiveAllScheduledTasksBeginAction
| KillAllScheduledTasksSuccessAction | ArchiveAllScheduledTasksSuccessAction
| KillAllScheduledTasksErrorAction | ArchiveAllScheduledTasksErrorAction
| DeleteAllScheduledTasksBeginAction | DeleteAllScheduledTasksBeginAction
| DeleteAllScheduledTasksSuccessAction | DeleteAllScheduledTasksSuccessAction
| DeleteAllScheduledTasksErrorAction | DeleteAllScheduledTasksErrorAction
@ -807,30 +819,30 @@ export type TasksActionTypes =
| RunAllRetryTasksBeginAction | RunAllRetryTasksBeginAction
| RunAllRetryTasksSuccessAction | RunAllRetryTasksSuccessAction
| RunAllRetryTasksErrorAction | RunAllRetryTasksErrorAction
| BatchKillRetryTasksBeginAction | BatchArchiveRetryTasksBeginAction
| BatchKillRetryTasksSuccessAction | BatchArchiveRetryTasksSuccessAction
| BatchKillRetryTasksErrorAction | BatchArchiveRetryTasksErrorAction
| KillAllRetryTasksBeginAction | ArchiveAllRetryTasksBeginAction
| KillAllRetryTasksSuccessAction | ArchiveAllRetryTasksSuccessAction
| KillAllRetryTasksErrorAction | ArchiveAllRetryTasksErrorAction
| DeleteAllRetryTasksBeginAction | DeleteAllRetryTasksBeginAction
| DeleteAllRetryTasksSuccessAction | DeleteAllRetryTasksSuccessAction
| DeleteAllRetryTasksErrorAction | DeleteAllRetryTasksErrorAction
| DeleteDeadTaskBeginAction | DeleteArchivedTaskBeginAction
| DeleteDeadTaskSuccessAction | DeleteArchivedTaskSuccessAction
| DeleteDeadTaskErrorAction | DeleteArchivedTaskErrorAction
| BatchDeleteDeadTasksBeginAction | BatchDeleteArchivedTasksBeginAction
| BatchDeleteDeadTasksSuccessAction | BatchDeleteArchivedTasksSuccessAction
| BatchDeleteDeadTasksErrorAction | BatchDeleteArchivedTasksErrorAction
| BatchRunDeadTasksBeginAction | BatchRunArchivedTasksBeginAction
| BatchRunDeadTasksSuccessAction | BatchRunArchivedTasksSuccessAction
| BatchRunDeadTasksErrorAction | BatchRunArchivedTasksErrorAction
| RunAllDeadTasksBeginAction | RunAllArchivedTasksBeginAction
| RunAllDeadTasksSuccessAction | RunAllArchivedTasksSuccessAction
| RunAllDeadTasksErrorAction | RunAllArchivedTasksErrorAction
| DeleteAllDeadTasksBeginAction | DeleteAllArchivedTasksBeginAction
| DeleteAllDeadTasksSuccessAction | DeleteAllArchivedTasksSuccessAction
| DeleteAllDeadTasksErrorAction; | DeleteAllArchivedTasksErrorAction;
export function listActiveTasksAsync( export function listActiveTasksAsync(
qname: string, qname: string,
@ -924,24 +936,24 @@ export function listRetryTasksAsync(
}; };
} }
export function listDeadTasksAsync( export function listArchivedTasksAsync(
qname: string, qname: string,
pageOpts?: PaginationOptions pageOpts?: PaginationOptions
) { ) {
return async (dispatch: Dispatch<TasksActionTypes>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: LIST_DEAD_TASKS_BEGIN, queue: qname }); dispatch({ type: LIST_ARCHIVED_TASKS_BEGIN, queue: qname });
try { try {
const response = await listDeadTasks(qname, pageOpts); const response = await listArchivedTasks(qname, pageOpts);
dispatch({ dispatch({
type: LIST_DEAD_TASKS_SUCCESS, type: LIST_ARCHIVED_TASKS_SUCCESS,
queue: qname, queue: qname,
payload: response, payload: response,
}); });
} catch { } catch {
dispatch({ dispatch({
type: LIST_DEAD_TASKS_ERROR, type: LIST_ARCHIVED_TASKS_ERROR,
queue: qname, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: KILL_SCHEDULED_TASK_BEGIN, queue, taskKey }); dispatch({ type: ARCHIVE_SCHEDULED_TASK_BEGIN, queue, taskKey });
try { try {
await killScheduledTask(queue, taskKey); await archiveScheduledTask(queue, taskKey);
dispatch({ type: KILL_SCHEDULED_TASK_SUCCESS, queue, taskKey }); dispatch({ type: ARCHIVE_SCHEDULED_TASK_SUCCESS, queue, taskKey });
} catch (error) { } catch (error) {
console.error("killScheduledTaskAsync: ", error); console.error("archiveScheduledTaskAsync: ", error);
dispatch({ dispatch({
type: KILL_SCHEDULED_TASK_ERROR, type: ARCHIVE_SCHEDULED_TASK_ERROR,
error: `Could not kill task: ${taskKey}`, error: `Could not archive task: ${taskKey}`,
queue, queue,
taskKey, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: KILL_RETRY_TASK_BEGIN, queue, taskKey }); dispatch({ type: ARCHIVE_RETRY_TASK_BEGIN, queue, taskKey });
try { try {
await killRetryTask(queue, taskKey); await archiveRetryTask(queue, taskKey);
dispatch({ type: KILL_RETRY_TASK_SUCCESS, queue, taskKey }); dispatch({ type: ARCHIVE_RETRY_TASK_SUCCESS, queue, taskKey });
} catch (error) { } catch (error) {
console.error("killRetryTaskAsync: ", error); console.error("archiveRetryTaskAsync: ", error);
dispatch({ dispatch({
type: KILL_RETRY_TASK_ERROR, type: ARCHIVE_RETRY_TASK_ERROR,
error: `Could not kill task: ${taskKey}`, error: `Could not archive task: ${taskKey}`,
queue, queue,
taskKey, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: RUN_DEAD_TASK_BEGIN, queue, taskKey }); dispatch({ type: RUN_ARCHIVED_TASK_BEGIN, queue, taskKey });
try { try {
await runDeadTask(queue, taskKey); await runArchivedTask(queue, taskKey);
dispatch({ type: RUN_DEAD_TASK_SUCCESS, queue, taskKey }); dispatch({ type: RUN_ARCHIVED_TASK_SUCCESS, queue, taskKey });
} catch (error) { } catch (error) {
console.error("runDeadTaskAsync: ", error); console.error("runArchivedTaskAsync: ", error);
dispatch({ dispatch({
type: RUN_DEAD_TASK_ERROR, type: RUN_ARCHIVED_TASK_ERROR,
error: `Could not run task: ${taskKey}`, error: `Could not run task: ${taskKey}`,
queue, queue,
taskKey, taskKey,
@ -1158,24 +1170,24 @@ export function batchRunScheduledTasksAsync(queue: string, taskKeys: string[]) {
}; };
} }
export function batchKillScheduledTasksAsync( export function batchArchiveScheduledTasksAsync(
queue: string, queue: string,
taskKeys: string[] taskKeys: string[]
) { ) {
return async (dispatch: Dispatch<TasksActionTypes>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: BATCH_KILL_SCHEDULED_TASKS_BEGIN, queue, taskKeys }); dispatch({ type: BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN, queue, taskKeys });
try { try {
const response = await batchKillScheduledTasks(queue, taskKeys); const response = await batchArchiveScheduledTasks(queue, taskKeys);
dispatch({ dispatch({
type: BATCH_KILL_SCHEDULED_TASKS_SUCCESS, type: BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
queue: queue, queue: queue,
payload: response, payload: response,
}); });
} catch (error) { } catch (error) {
console.error("batchKillScheduledTasksAsync: ", error); console.error("batchArchiveScheduledTasksAsync: ", error);
dispatch({ dispatch({
type: BATCH_KILL_SCHEDULED_TASKS_ERROR, type: BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR,
error: `Could not batch kill tasks: ${taskKeys}`, error: `Could not batch archive tasks: ${taskKeys}`,
queue, queue,
taskKeys, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_BEGIN, queue }); dispatch({ type: RUN_ALL_SCHEDULED_TASKS_BEGIN, queue });
try { try {
await killAllScheduledTasks(queue); await archiveAllScheduledTasks(queue);
dispatch({ type: RUN_ALL_SCHEDULED_TASKS_SUCCESS, queue }); dispatch({ type: RUN_ALL_SCHEDULED_TASKS_SUCCESS, queue });
} catch (error) { } catch (error) {
console.error("killAllScheduledTasksAsync: ", error); console.error("archiveAllScheduledTasksAsync: ", error);
dispatch({ dispatch({
type: RUN_ALL_SCHEDULED_TASKS_ERROR, type: RUN_ALL_SCHEDULED_TASKS_ERROR,
error: `Could not kill all scheduled tasks`, error: `Could not archive all scheduled tasks`,
queue, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: BATCH_KILL_RETRY_TASKS_BEGIN, queue, taskKeys }); dispatch({ type: BATCH_ARCHIVE_RETRY_TASKS_BEGIN, queue, taskKeys });
try { try {
const response = await batchKillRetryTasks(queue, taskKeys); const response = await batchArchiveRetryTasks(queue, taskKeys);
dispatch({ dispatch({
type: BATCH_KILL_RETRY_TASKS_SUCCESS, type: BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
queue: queue, queue: queue,
payload: response, payload: response,
}); });
} catch (error) { } catch (error) {
console.error("batchKillRetryTasksAsync: ", error); console.error("batchArchiveRetryTasksAsync: ", error);
dispatch({ dispatch({
type: BATCH_KILL_RETRY_TASKS_ERROR, type: BATCH_ARCHIVE_RETRY_TASKS_ERROR,
error: `Could not batch kill tasks: ${taskKeys}`, error: `Could not batch archive tasks: ${taskKeys}`,
queue, queue,
taskKeys, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: KILL_ALL_RETRY_TASKS_BEGIN, queue }); dispatch({ type: ARCHIVE_ALL_RETRY_TASKS_BEGIN, queue });
try { try {
await killAllRetryTasks(queue); await archiveAllRetryTasks(queue);
dispatch({ type: KILL_ALL_RETRY_TASKS_SUCCESS, queue }); dispatch({ type: ARCHIVE_ALL_RETRY_TASKS_SUCCESS, queue });
} catch (error) { } catch (error) {
console.error("killAllRetryTasksAsync: ", error); console.error("archiveAllRetryTasksAsync: ", error);
dispatch({ dispatch({
type: KILL_ALL_RETRY_TASKS_ERROR, type: ARCHIVE_ALL_RETRY_TASKS_ERROR,
error: `Could not kill all retry tasks`, error: `Could not archive all retry tasks`,
queue, queue,
}); });
} }
}; };
} }
export function deleteDeadTaskAsync(queue: string, taskKey: string) { export function deleteArchivedTaskAsync(queue: string, taskKey: string) {
return async (dispatch: Dispatch<TasksActionTypes>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: DELETE_DEAD_TASK_BEGIN, queue, taskKey }); dispatch({ type: DELETE_ARCHIVED_TASK_BEGIN, queue, taskKey });
try { try {
await deleteDeadTask(queue, taskKey); await deleteArchivedTask(queue, taskKey);
dispatch({ type: DELETE_DEAD_TASK_SUCCESS, queue, taskKey }); dispatch({ type: DELETE_ARCHIVED_TASK_SUCCESS, queue, taskKey });
} catch (error) { } catch (error) {
console.error("deleteDeadTaskAsync: ", error); console.error("deleteArchivedTaskAsync: ", error);
dispatch({ dispatch({
type: DELETE_DEAD_TASK_ERROR, type: DELETE_ARCHIVED_TASK_ERROR,
error: `Could not delete task: ${taskKey}`, error: `Could not delete task: ${taskKey}`,
queue, queue,
taskKey, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: BATCH_DELETE_DEAD_TASKS_BEGIN, queue, taskKeys }); dispatch({ type: BATCH_DELETE_ARCHIVED_TASKS_BEGIN, queue, taskKeys });
try { try {
const response = await batchDeleteDeadTasks(queue, taskKeys); const response = await batchDeleteArchivedTasks(queue, taskKeys);
dispatch({ dispatch({
type: BATCH_DELETE_DEAD_TASKS_SUCCESS, type: BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
queue: queue, queue: queue,
payload: response, payload: response,
}); });
} catch (error) { } catch (error) {
console.error("batchDeleteDeadTasksAsync: ", error); console.error("batchDeleteArchivedTasksAsync: ", error);
dispatch({ dispatch({
type: BATCH_DELETE_DEAD_TASKS_ERROR, type: BATCH_DELETE_ARCHIVED_TASKS_ERROR,
error: `Could not batch delete tasks: ${taskKeys}`, error: `Could not batch delete tasks: ${taskKeys}`,
queue, queue,
taskKeys, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: BATCH_RUN_DEAD_TASKS_BEGIN, queue, taskKeys }); dispatch({ type: BATCH_RUN_ARCHIVED_TASKS_BEGIN, queue, taskKeys });
try { try {
const response = await batchRunDeadTasks(queue, taskKeys); const response = await batchRunArchivedTasks(queue, taskKeys);
dispatch({ dispatch({
type: BATCH_RUN_DEAD_TASKS_SUCCESS, type: BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
queue: queue, queue: queue,
payload: response, payload: response,
}); });
} catch (error) { } catch (error) {
console.error("batchRunDeadTasksAsync: ", error); console.error("batchRunArchivedTasksAsync: ", error);
dispatch({ dispatch({
type: BATCH_RUN_DEAD_TASKS_ERROR, type: BATCH_RUN_ARCHIVED_TASKS_ERROR,
error: `Could not batch run tasks: ${taskKeys}`, error: `Could not batch run tasks: ${taskKeys}`,
queue, queue,
taskKeys, 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>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: DELETE_ALL_DEAD_TASKS_BEGIN, queue }); dispatch({ type: DELETE_ALL_ARCHIVED_TASKS_BEGIN, queue });
try { try {
await deleteAllDeadTasks(queue); await deleteAllArchivedTasks(queue);
dispatch({ type: DELETE_ALL_DEAD_TASKS_SUCCESS, queue }); dispatch({ type: DELETE_ALL_ARCHIVED_TASKS_SUCCESS, queue });
} catch (error) { } catch (error) {
console.error("deleteAllDeadTasksAsync: ", error); console.error("deleteAllArchivedTasksAsync: ", error);
dispatch({ dispatch({
type: DELETE_ALL_DEAD_TASKS_ERROR, type: DELETE_ALL_ARCHIVED_TASKS_ERROR,
error: `Could not delete all dead tasks`, error: `Could not delete all archived tasks`,
queue, queue,
}); });
} }
}; };
} }
export function runAllDeadTasksAsync(queue: string) { export function runAllArchivedTasksAsync(queue: string) {
return async (dispatch: Dispatch<TasksActionTypes>) => { return async (dispatch: Dispatch<TasksActionTypes>) => {
dispatch({ type: RUN_ALL_DEAD_TASKS_BEGIN, queue }); dispatch({ type: RUN_ALL_ARCHIVED_TASKS_BEGIN, queue });
try { try {
await runAllDeadTasks(queue); await runAllArchivedTasks(queue);
dispatch({ type: RUN_ALL_DEAD_TASKS_SUCCESS, queue }); dispatch({ type: RUN_ALL_ARCHIVED_TASKS_SUCCESS, queue });
} catch (error) { } catch (error) {
console.error("runAllDeadTasksAsync: ", error); console.error("runAllArchivedTasksAsync: ", error);
dispatch({ dispatch({
type: RUN_ALL_DEAD_TASKS_ERROR, type: RUN_ALL_ARCHIVED_TASKS_ERROR,
error: `Could not run all dead tasks`, error: `Could not run all archived tasks`,
queue, queue,
}); });
} }

View File

@ -31,8 +31,8 @@ export interface ListRetryTasksResponse {
stats: Queue; stats: Queue;
} }
export interface ListDeadTasksResponse { export interface ListArchivedTasksResponse {
tasks: DeadTask[]; tasks: ArchivedTask[];
stats: Queue; stats: Queue;
} }
@ -63,8 +63,8 @@ export interface BatchRunTasksResponse {
error_keys: string[]; error_keys: string[];
} }
export interface BatchKillTasksResponse { export interface BatchArchiveTasksResponse {
dead_keys: string[]; archived_keys: string[];
error_keys: string[]; error_keys: string[];
} }
@ -221,7 +221,7 @@ export interface Queue {
pending: number; pending: number;
scheduled: number; scheduled: number;
retry: number; retry: number;
dead: number; archived: number;
processed: number; processed: number;
failed: number; failed: number;
timestamp: string; timestamp: string;
@ -267,7 +267,7 @@ export interface RetryTask extends BaseTask {
error_message: string; error_message: string;
} }
export interface DeadTask extends BaseTask { export interface ArchivedTask extends BaseTask {
id: string; id: string;
key: string; key: string;
queue: string; queue: string;
@ -444,11 +444,11 @@ export async function listRetryTasks(
return resp.data; return resp.data;
} }
export async function listDeadTasks( export async function listArchivedTasks(
qname: string, qname: string,
pageOpts?: PaginationOptions pageOpts?: PaginationOptions
): Promise<ListDeadTasksResponse> { ): Promise<ListArchivedTasksResponse> {
let url = `${BASE_URL}/queues/${qname}/dead_tasks`; let url = `${BASE_URL}/queues/${qname}/archived_tasks`;
if (pageOpts) { if (pageOpts) {
url += `?${queryString.stringify(pageOpts)}`; url += `?${queryString.stringify(pageOpts)}`;
} }
@ -469,13 +469,13 @@ export async function runScheduledTask(
}); });
} }
export async function killScheduledTask( export async function archiveScheduledTask(
qname: string, qname: string,
taskKey: string taskKey: string
): Promise<void> { ): Promise<void> {
await axios({ await axios({
method: "post", 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, qname: string,
taskKeys: string[] taskKeys: string[]
): Promise<BatchKillTasksResponse> { ): Promise<BatchArchiveTasksResponse> {
const resp = await axios({ const resp = await axios({
method: "post", method: "post",
url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_kill`, url: `${BASE_URL}/queues/${qname}/scheduled_tasks:batch_archive`,
data: { data: {
task_keys: taskKeys, task_keys: taskKeys,
}, },
@ -545,10 +545,10 @@ export async function batchKillScheduledTasks(
return resp.data; return resp.data;
} }
export async function killAllScheduledTasks(qname: string): Promise<void> { export async function archiveAllScheduledTasks(qname: string): Promise<void> {
await axios({ await axios({
method: "post", 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, qname: string,
taskKey: string taskKey: string
): Promise<void> { ): Promise<void> {
await axios({ await axios({
method: "post", 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, qname: string,
taskKeys: string[] taskKeys: string[]
): Promise<BatchKillTasksResponse> { ): Promise<BatchArchiveTasksResponse> {
const resp = await axios({ const resp = await axios({
method: "post", method: "post",
url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_kill`, url: `${BASE_URL}/queues/${qname}/retry_tasks:batch_archive`,
data: { data: {
task_keys: taskKeys, task_keys: taskKeys,
}, },
@ -638,40 +638,40 @@ export async function batchKillRetryTasks(
return resp.data; return resp.data;
} }
export async function killAllRetryTasks(qname: string): Promise<void> { export async function archiveAllRetryTasks(qname: string): Promise<void> {
await axios({ await axios({
method: "post", 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, qname: string,
taskKey: string taskKey: string
): Promise<void> { ): Promise<void> {
await axios({ await axios({
method: "post", 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, qname: string,
taskKey: string taskKey: string
): Promise<void> { ): Promise<void> {
await axios({ await axios({
method: "delete", 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, qname: string,
taskKeys: string[] taskKeys: string[]
): Promise<BatchDeleteTasksResponse> { ): Promise<BatchDeleteTasksResponse> {
const resp = await axios({ const resp = await axios({
method: "post", method: "post",
url: `${BASE_URL}/queues/${qname}/dead_tasks:batch_delete`, url: `${BASE_URL}/queues/${qname}/archived_tasks:batch_delete`,
data: { data: {
task_keys: taskKeys, task_keys: taskKeys,
}, },
@ -679,20 +679,20 @@ export async function batchDeleteDeadTasks(
return resp.data; return resp.data;
} }
export async function deleteAllDeadTasks(qname: string): Promise<void> { export async function deleteAllArchivedTasks(qname: string): Promise<void> {
await axios({ await axios({
method: "delete", 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, qname: string,
taskKeys: string[] taskKeys: string[]
): Promise<BatchRunTasksResponse> { ): Promise<BatchRunTasksResponse> {
const resp = await axios({ const resp = await axios({
method: "post", method: "post",
url: `${BASE_URL}/queues/${qname}/dead_tasks:batch_run`, url: `${BASE_URL}/queues/${qname}/archived_tasks:batch_run`,
data: { data: {
task_keys: taskKeys, task_keys: taskKeys,
}, },
@ -700,10 +700,10 @@ export async function batchRunDeadTasks(
return resp.data; return resp.data;
} }
export async function runAllDeadTasks(qname: string): Promise<void> { export async function runAllArchivedTasks(qname: string): Promise<void> {
await axios({ await axios({
method: "post", method: "post",
url: `${BASE_URL}/queues/${qname}/dead_tasks:run_all`, url: `${BASE_URL}/queues/${qname}/archived_tasks:run_all`,
}); });
} }

View 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);

View File

@ -28,13 +28,13 @@ import SyntaxHighlighter from "react-syntax-highlighter";
import syntaxHighlightStyle from "react-syntax-highlighter/dist/esm/styles/hljs/github"; import syntaxHighlightStyle from "react-syntax-highlighter/dist/esm/styles/hljs/github";
import { AppState } from "../store"; import { AppState } from "../store";
import { import {
batchDeleteDeadTasksAsync, batchDeleteArchivedTasksAsync,
batchRunDeadTasksAsync, batchRunArchivedTasksAsync,
deleteDeadTaskAsync, deleteArchivedTaskAsync,
deleteAllDeadTasksAsync, deleteAllArchivedTasksAsync,
listDeadTasksAsync, listArchivedTasksAsync,
runDeadTaskAsync, runArchivedTaskAsync,
runAllDeadTasksAsync, runAllArchivedTasksAsync,
} from "../actions/tasksActions"; } from "../actions/tasksActions";
import TablePaginationActions, { import TablePaginationActions, {
defaultPageSize, defaultPageSize,
@ -43,7 +43,7 @@ import TablePaginationActions, {
import TableActions from "./TableActions"; import TableActions from "./TableActions";
import { timeAgo, uuidPrefix } from "../utils"; import { timeAgo, uuidPrefix } from "../utils";
import { usePolling } from "../hooks"; import { usePolling } from "../hooks";
import { DeadTaskExtended } from "../reducers/tasksReducer"; import { ArchivedTaskExtended } from "../reducers/tasksReducer";
import { TableColumn } from "../types/table"; import { TableColumn } from "../types/table";
const useStyles = makeStyles({ const useStyles = makeStyles({
@ -69,22 +69,22 @@ const useRowStyles = makeStyles({
function mapStateToProps(state: AppState) { function mapStateToProps(state: AppState) {
return { return {
loading: state.tasks.deadTasks.loading, loading: state.tasks.archivedTasks.loading,
tasks: state.tasks.deadTasks.data, tasks: state.tasks.archivedTasks.data,
batchActionPending: state.tasks.deadTasks.batchActionPending, batchActionPending: state.tasks.archivedTasks.batchActionPending,
allActionPending: state.tasks.deadTasks.allActionPending, allActionPending: state.tasks.archivedTasks.allActionPending,
pollInterval: state.settings.pollInterval, pollInterval: state.settings.pollInterval,
}; };
} }
const mapDispatchToProps = { const mapDispatchToProps = {
listDeadTasksAsync, listArchivedTasksAsync,
runDeadTaskAsync, runArchivedTaskAsync,
runAllDeadTasksAsync, runAllArchivedTasksAsync,
deleteDeadTaskAsync, deleteArchivedTaskAsync,
deleteAllDeadTasksAsync, deleteAllArchivedTasksAsync,
batchRunDeadTasksAsync, batchRunArchivedTasksAsync,
batchDeleteDeadTasksAsync, batchDeleteArchivedTasksAsync,
}; };
const connector = connect(mapStateToProps, mapDispatchToProps); const connector = connect(mapStateToProps, mapDispatchToProps);
@ -93,11 +93,11 @@ type ReduxProps = ConnectedProps<typeof connector>;
interface Props { interface Props {
queue: string; // name of the queue. 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) { function ArchivedTasksTable(props: Props & ReduxProps) {
const { pollInterval, listDeadTasksAsync, queue } = props; const { pollInterval, listArchivedTasksAsync, queue } = props;
const classes = useStyles(); const classes = useStyles();
const [page, setPage] = useState(0); const [page, setPage] = useState(0);
const [pageSize, setPageSize] = useState(defaultPageSize); const [pageSize, setPageSize] = useState(defaultPageSize);
@ -128,29 +128,29 @@ function DeadTasksTable(props: Props & ReduxProps) {
}; };
const handleRunAllClick = () => { const handleRunAllClick = () => {
props.runAllDeadTasksAsync(queue); props.runAllArchivedTasksAsync(queue);
}; };
const handleDeleteAllClick = () => { const handleDeleteAllClick = () => {
props.deleteAllDeadTasksAsync(queue); props.deleteAllArchivedTasksAsync(queue);
}; };
const handleBatchRunClick = () => { const handleBatchRunClick = () => {
props props
.batchRunDeadTasksAsync(queue, selectedKeys) .batchRunArchivedTasksAsync(queue, selectedKeys)
.then(() => setSelectedKeys([])); .then(() => setSelectedKeys([]));
}; };
const handleBatchDeleteClick = () => { const handleBatchDeleteClick = () => {
props props
.batchDeleteDeadTasksAsync(queue, selectedKeys) .batchDeleteArchivedTasksAsync(queue, selectedKeys)
.then(() => setSelectedKeys([])); .then(() => setSelectedKeys([]));
}; };
const fetchData = useCallback(() => { const fetchData = useCallback(() => {
const pageOpts = { page: page + 1, size: pageSize }; const pageOpts = { page: page + 1, size: pageSize };
listDeadTasksAsync(queue, pageOpts); listArchivedTasksAsync(queue, pageOpts);
}, [page, pageSize, queue, listDeadTasksAsync]); }, [page, pageSize, queue, listArchivedTasksAsync]);
usePolling(fetchData, pollInterval); usePolling(fetchData, pollInterval);
@ -158,7 +158,7 @@ function DeadTasksTable(props: Props & ReduxProps) {
return ( return (
<Alert severity="info"> <Alert severity="info">
<AlertTitle>Info</AlertTitle> <AlertTitle>Info</AlertTitle>
No dead tasks at this time. No archived tasks at this time.
</Alert> </Alert>
); );
} }
@ -209,7 +209,7 @@ function DeadTasksTable(props: Props & ReduxProps) {
<Table <Table
stickyHeader={true} stickyHeader={true}
className={classes.table} className={classes.table}
aria-label="dead tasks table" aria-label="archived tasks table"
size="small" size="small"
> >
<TableHead> <TableHead>
@ -247,10 +247,10 @@ function DeadTasksTable(props: Props & ReduxProps) {
} }
}} }}
onRunClick={() => { onRunClick={() => {
props.runDeadTaskAsync(queue, task.key); props.runArchivedTaskAsync(queue, task.key);
}} }}
onDeleteClick={() => { onDeleteClick={() => {
props.deleteDeadTaskAsync(queue, task.key); props.deleteArchivedTaskAsync(queue, task.key);
}} }}
allActionPending={props.allActionPending} allActionPending={props.allActionPending}
onActionCellEnter={() => setActiveTaskId(task.id)} onActionCellEnter={() => setActiveTaskId(task.id)}
@ -284,7 +284,7 @@ function DeadTasksTable(props: Props & ReduxProps) {
} }
interface RowProps { interface RowProps {
task: DeadTaskExtended; task: ArchivedTaskExtended;
isSelected: boolean; isSelected: boolean;
onSelectChange: (checked: boolean) => void; onSelectChange: (checked: boolean) => void;
onRunClick: () => void; onRunClick: () => void;
@ -386,4 +386,4 @@ function Row(props: RowProps) {
); );
} }
export default connector(DeadTasksTable); export default connector(ArchivedTasksTable);

View File

@ -20,7 +20,7 @@ interface TaskBreakdown {
pending: number; // number of pending tasks in the queue. pending: number; // number of pending tasks in the queue.
scheduled: number; // number of scheduled tasks in the queue. scheduled: number; // number of scheduled tasks in the queue.
retry: number; // number of retry 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) { function QueueSizeChart(props: Props) {
@ -36,7 +36,7 @@ function QueueSizeChart(props: Props) {
<Bar dataKey="pending" stackId="a" fill="#669df6" /> <Bar dataKey="pending" stackId="a" fill="#669df6" />
<Bar dataKey="scheduled" stackId="a" fill="#fdd663" /> <Bar dataKey="scheduled" stackId="a" fill="#fdd663" />
<Bar dataKey="retry" stackId="a" fill="#f666a9" /> <Bar dataKey="retry" stackId="a" fill="#f666a9" />
<Bar dataKey="dead" stackId="a" fill="#ac4776" /> <Bar dataKey="archived" stackId="a" fill="#ac4776" />
</BarChart> </BarChart>
</ResponsiveContainer> </ResponsiveContainer>
); );

View File

@ -67,7 +67,7 @@ enum SortBy {
Pending, Pending,
Scheduled, Scheduled,
Retry, Retry,
Dead, Archived,
None, // no sort support None, // no sort support
} }
@ -84,7 +84,12 @@ const colConfigs: SortableTableColumn<SortBy>[] = [
align: "right", align: "right",
}, },
{ label: "Retry", key: "retry", sortBy: SortBy.Retry, 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" }, { 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; if (q1.retry === q2.retry) return 0;
isQ1Smaller = q1.retry < q2.retry; isQ1Smaller = q1.retry < q2.retry;
break; break;
case SortBy.Dead: case SortBy.Archived:
if (q1.dead === q2.dead) return 0; if (q1.archived === q2.archived) return 0;
isQ1Smaller = q1.dead < q2.dead; isQ1Smaller = q1.archived < q2.archived;
break; break;
default: default:
// eslint-disable-next-line no-throw-literal // eslint-disable-next-line no-throw-literal
@ -248,10 +253,10 @@ export default function QueuesOverviewTable(props: Props) {
</TableCell> </TableCell>
<TableCell align="right"> <TableCell align="right">
<Link <Link
to={queueDetailsPath(q.queue, "dead")} to={queueDetailsPath(q.queue, "archived")}
className={classes.linkCell} className={classes.linkCell}
> >
{q.dead} {q.archived}
</Link> </Link>
</TableCell> </TableCell>
<TableCell align="center"> <TableCell align="center">
@ -318,7 +323,7 @@ export default function QueuesOverviewTable(props: Props) {
{total.retry} {total.retry}
</TableCell> </TableCell>
<TableCell className={classes.footerCell} align="right"> <TableCell className={classes.footerCell} align="right">
{total.dead} {total.archived}
</TableCell> </TableCell>
</TableRow> </TableRow>
</TableFooter> </TableFooter>
@ -338,7 +343,7 @@ interface AggregateCounts {
pending: number; pending: number;
scheduled: number; scheduled: number;
retry: number; retry: number;
dead: number; archived: number;
} }
function getAggregateCounts(queues: Queue[]): AggregateCounts { function getAggregateCounts(queues: Queue[]): AggregateCounts {
@ -348,7 +353,7 @@ function getAggregateCounts(queues: Queue[]): AggregateCounts {
pending: 0, pending: 0,
scheduled: 0, scheduled: 0,
retry: 0, retry: 0,
dead: 0, archived: 0,
}; };
queues.forEach((q) => { queues.forEach((q) => {
total.size += q.size; total.size += q.size;
@ -356,7 +361,7 @@ function getAggregateCounts(queues: Queue[]): AggregateCounts {
total.pending += q.pending; total.pending += q.pending;
total.scheduled += q.scheduled; total.scheduled += q.scheduled;
total.retry += q.retry; total.retry += q.retry;
total.dead += q.dead; total.archived += q.archived;
}); });
return total; return total;
} }

View File

@ -29,14 +29,14 @@ import syntaxHighlightStyle from "react-syntax-highlighter/dist/esm/styles/hljs/
import { import {
batchDeleteRetryTasksAsync, batchDeleteRetryTasksAsync,
batchRunRetryTasksAsync, batchRunRetryTasksAsync,
batchKillRetryTasksAsync, batchArchiveRetryTasksAsync,
deleteAllRetryTasksAsync, deleteAllRetryTasksAsync,
runAllRetryTasksAsync, runAllRetryTasksAsync,
killAllRetryTasksAsync, archiveAllRetryTasksAsync,
listRetryTasksAsync, listRetryTasksAsync,
deleteRetryTaskAsync, deleteRetryTaskAsync,
runRetryTaskAsync, runRetryTaskAsync,
killRetryTaskAsync, archiveRetryTaskAsync,
} from "../actions/tasksActions"; } from "../actions/tasksActions";
import { AppState } from "../store"; import { AppState } from "../store";
import TablePaginationActions, { import TablePaginationActions, {
@ -69,14 +69,14 @@ function mapStateToProps(state: AppState) {
const mapDispatchToProps = { const mapDispatchToProps = {
batchDeleteRetryTasksAsync, batchDeleteRetryTasksAsync,
batchRunRetryTasksAsync, batchRunRetryTasksAsync,
batchKillRetryTasksAsync, batchArchiveRetryTasksAsync,
deleteAllRetryTasksAsync, deleteAllRetryTasksAsync,
runAllRetryTasksAsync, runAllRetryTasksAsync,
killAllRetryTasksAsync, archiveAllRetryTasksAsync,
listRetryTasksAsync, listRetryTasksAsync,
deleteRetryTaskAsync, deleteRetryTaskAsync,
runRetryTaskAsync, runRetryTaskAsync,
killRetryTaskAsync, archiveRetryTaskAsync,
}; };
const connector = connect(mapStateToProps, mapDispatchToProps); const connector = connect(mapStateToProps, mapDispatchToProps);
@ -127,8 +127,8 @@ function RetryTasksTable(props: Props & ReduxProps) {
props.deleteAllRetryTasksAsync(queue); props.deleteAllRetryTasksAsync(queue);
}; };
const handleKillAllClick = () => { const handleArchiveAllClick = () => {
props.killAllRetryTasksAsync(queue); props.archiveAllRetryTasksAsync(queue);
}; };
const handleBatchRunClick = () => { const handleBatchRunClick = () => {
@ -143,9 +143,9 @@ function RetryTasksTable(props: Props & ReduxProps) {
.then(() => setSelectedKeys([])); .then(() => setSelectedKeys([]));
}; };
const handleBatchKillClick = () => { const handleBatchArchiveClick = () => {
props props
.batchKillRetryTasksAsync(queue, selectedKeys) .batchArchiveRetryTasksAsync(queue, selectedKeys)
.then(() => setSelectedKeys([])); .then(() => setSelectedKeys([]));
}; };
@ -190,9 +190,9 @@ function RetryTasksTable(props: Props & ReduxProps) {
disabled: props.batchActionPending, disabled: props.batchActionPending,
}, },
{ {
tooltip: "Kill", tooltip: "Archive",
icon: <ArchiveIcon />, icon: <ArchiveIcon />,
onClick: handleBatchKillClick, onClick: handleBatchArchiveClick,
disabled: props.batchActionPending, disabled: props.batchActionPending,
}, },
{ {
@ -209,8 +209,8 @@ function RetryTasksTable(props: Props & ReduxProps) {
disabled: props.allActionPending, disabled: props.allActionPending,
}, },
{ {
label: "Kill All", label: "Archive All",
onClick: handleKillAllClick, onClick: handleArchiveAllClick,
disabled: props.allActionPending, disabled: props.allActionPending,
}, },
{ {
@ -268,8 +268,8 @@ function RetryTasksTable(props: Props & ReduxProps) {
onDeleteClick={() => { onDeleteClick={() => {
props.deleteRetryTaskAsync(task.queue, task.key); props.deleteRetryTaskAsync(task.queue, task.key);
}} }}
onKillClick={() => { onArchiveClick={() => {
props.killRetryTaskAsync(task.queue, task.key); props.archiveRetryTaskAsync(task.queue, task.key);
}} }}
onActionCellEnter={() => setActiveTaskId(task.id)} onActionCellEnter={() => setActiveTaskId(task.id)}
onActionCellLeave={() => setActiveTaskId("")} onActionCellLeave={() => setActiveTaskId("")}
@ -322,7 +322,7 @@ interface RowProps {
onSelectChange: (checked: boolean) => void; onSelectChange: (checked: boolean) => void;
onDeleteClick: () => void; onDeleteClick: () => void;
onRunClick: () => void; onRunClick: () => void;
onKillClick: () => void; onArchiveClick: () => void;
allActionPending: boolean; allActionPending: boolean;
showActions: boolean; showActions: boolean;
onActionCellEnter: () => void; onActionCellEnter: () => void;
@ -387,9 +387,9 @@ function Row(props: RowProps) {
<DeleteIcon fontSize="small" /> <DeleteIcon fontSize="small" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip title="Kill"> <Tooltip title="Archive">
<IconButton <IconButton
onClick={props.onKillClick} onClick={props.onArchiveClick}
disabled={task.requestPending || props.allActionPending} disabled={task.requestPending || props.allActionPending}
size="small" size="small"
> >

View File

@ -30,14 +30,14 @@ import syntaxHighlightStyle from "react-syntax-highlighter/dist/esm/styles/hljs/
import { import {
batchDeleteScheduledTasksAsync, batchDeleteScheduledTasksAsync,
batchRunScheduledTasksAsync, batchRunScheduledTasksAsync,
batchKillScheduledTasksAsync, batchArchiveScheduledTasksAsync,
deleteAllScheduledTasksAsync, deleteAllScheduledTasksAsync,
runAllScheduledTasksAsync, runAllScheduledTasksAsync,
killAllScheduledTasksAsync, archiveAllScheduledTasksAsync,
listScheduledTasksAsync, listScheduledTasksAsync,
deleteScheduledTaskAsync, deleteScheduledTaskAsync,
runScheduledTaskAsync, runScheduledTaskAsync,
killScheduledTaskAsync, archiveScheduledTaskAsync,
} from "../actions/tasksActions"; } from "../actions/tasksActions";
import { AppState } from "../store"; import { AppState } from "../store";
import TablePaginationActions, { import TablePaginationActions, {
@ -70,13 +70,13 @@ const mapDispatchToProps = {
listScheduledTasksAsync, listScheduledTasksAsync,
batchDeleteScheduledTasksAsync, batchDeleteScheduledTasksAsync,
batchRunScheduledTasksAsync, batchRunScheduledTasksAsync,
batchKillScheduledTasksAsync, batchArchiveScheduledTasksAsync,
deleteAllScheduledTasksAsync, deleteAllScheduledTasksAsync,
runAllScheduledTasksAsync, runAllScheduledTasksAsync,
killAllScheduledTasksAsync, archiveAllScheduledTasksAsync,
deleteScheduledTaskAsync, deleteScheduledTaskAsync,
runScheduledTaskAsync, runScheduledTaskAsync,
killScheduledTaskAsync, archiveScheduledTaskAsync,
}; };
const connector = connect(mapStateToProps, mapDispatchToProps); const connector = connect(mapStateToProps, mapDispatchToProps);
@ -127,8 +127,8 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
props.deleteAllScheduledTasksAsync(queue); props.deleteAllScheduledTasksAsync(queue);
}; };
const handleKillAllClick = () => { const handleArchiveAllClick = () => {
props.killAllScheduledTasksAsync(queue); props.archiveAllScheduledTasksAsync(queue);
}; };
const handleBatchRunClick = () => { const handleBatchRunClick = () => {
@ -143,9 +143,9 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
.then(() => setSelectedKeys([])); .then(() => setSelectedKeys([]));
}; };
const handleBatchKillClick = () => { const handleBatchArchiveClick = () => {
props props
.batchKillScheduledTasksAsync(queue, selectedKeys) .batchArchiveScheduledTasksAsync(queue, selectedKeys)
.then(() => setSelectedKeys([])); .then(() => setSelectedKeys([]));
}; };
@ -187,9 +187,9 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
disabled: props.batchActionPending, disabled: props.batchActionPending,
}, },
{ {
tooltip: "Kill", tooltip: "Archive",
icon: <ArchiveIcon />, icon: <ArchiveIcon />,
onClick: handleBatchKillClick, onClick: handleBatchArchiveClick,
disabled: props.batchActionPending, disabled: props.batchActionPending,
}, },
{ {
@ -206,8 +206,8 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
disabled: props.allActionPending, disabled: props.allActionPending,
}, },
{ {
label: "Kill All", label: "Archive All",
onClick: handleKillAllClick, onClick: handleArchiveAllClick,
disabled: props.allActionPending, disabled: props.allActionPending,
}, },
{ {
@ -265,8 +265,8 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
onDeleteClick={() => { onDeleteClick={() => {
props.deleteScheduledTaskAsync(queue, task.key); props.deleteScheduledTaskAsync(queue, task.key);
}} }}
onKillClick={() => { onArchiveClick={() => {
props.killScheduledTaskAsync(queue, task.key); props.archiveScheduledTaskAsync(queue, task.key);
}} }}
onActionCellEnter={() => setActiveTaskId(task.id)} onActionCellEnter={() => setActiveTaskId(task.id)}
onActionCellLeave={() => setActiveTaskId("")} onActionCellLeave={() => setActiveTaskId("")}
@ -319,7 +319,7 @@ interface RowProps {
onSelectChange: (checked: boolean) => void; onSelectChange: (checked: boolean) => void;
onRunClick: () => void; onRunClick: () => void;
onDeleteClick: () => void; onDeleteClick: () => void;
onKillClick: () => void; onArchiveClick: () => void;
allActionPending: boolean; allActionPending: boolean;
showActions: boolean; showActions: boolean;
onActionCellEnter: () => void; onActionCellEnter: () => void;
@ -381,9 +381,9 @@ function Row(props: RowProps) {
<DeleteIcon fontSize="small" /> <DeleteIcon fontSize="small" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip title="Kill"> <Tooltip title="Archive">
<IconButton <IconButton
onClick={props.onKillClick} onClick={props.onArchiveClick}
disabled={task.requestPending || props.allActionPending} disabled={task.requestPending || props.allActionPending}
size="small" size="small"
> >

View File

@ -8,7 +8,7 @@ import ActiveTasksTable from "./ActiveTasksTable";
import PendingTasksTable from "./PendingTasksTable"; import PendingTasksTable from "./PendingTasksTable";
import ScheduledTasksTable from "./ScheduledTasksTable"; import ScheduledTasksTable from "./ScheduledTasksTable";
import RetryTasksTable from "./RetryTasksTable"; import RetryTasksTable from "./RetryTasksTable";
import DeadTasksTable from "./DeadTasksTable"; import ArchivedTasksTable from "./ArchivedTasksTable";
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
import { queueDetailsPath } from "../paths"; import { queueDetailsPath } from "../paths";
import { Typography } from "@material-ui/core"; import { Typography } from "@material-ui/core";
@ -166,7 +166,7 @@ function mapStatetoProps(state: AppState, ownProps: Props) {
pending: 0, pending: 0,
scheduled: 0, scheduled: 0,
retry: 0, retry: 0,
dead: 0, archived: 0,
processed: 0, processed: 0,
failed: 0, failed: 0,
timestamp: "n/a", timestamp: "n/a",
@ -246,15 +246,15 @@ function TasksTable(props: Props & ReduxProps) {
{...a11yProps("retry")} {...a11yProps("retry")}
/> />
<Tab <Tab
value="dead" value="archived"
label="Dead" label="Archived"
icon={<TaskCount>{currentStats.dead}</TaskCount>} icon={<TaskCount>{currentStats.archived}</TaskCount>}
classes={{ classes={{
root: classes.tabroot, root: classes.tabroot,
wrapper: classes.tabwrapper, wrapper: classes.tabwrapper,
selected: classes.tabSelected, selected: classes.tabSelected,
}} }}
{...a11yProps("dead")} {...a11yProps("archived")}
/> />
</Tabs> </Tabs>
</TabsContainer> </TabsContainer>
@ -311,7 +311,7 @@ function TasksTable(props: Props & ReduxProps) {
/> />
</PanelContainer> </PanelContainer>
</TabPanel> </TabPanel>
<TabPanel value="dead" selected={props.selected}> <TabPanel value="archived" selected={props.selected}>
<PanelContainer> <PanelContainer>
<PanelHeading <PanelHeading
queue={props.queue} queue={props.queue}
@ -319,9 +319,9 @@ function TasksTable(props: Props & ReduxProps) {
failed={currentStats.failed} failed={currentStats.failed}
paused={currentStats.paused} paused={currentStats.paused}
/> />
<DeadTasksTable <ArchivedTasksTable
queue={props.queue} queue={props.queue}
totalTaskCount={currentStats.dead} totalTaskCount={currentStats.archived}
/> />
</PanelContainer> </PanelContainer>
</TabPanel> </TabPanel>

View File

@ -14,33 +14,33 @@ import {
LIST_QUEUES_ERROR, LIST_QUEUES_ERROR,
} from "../actions/queuesActions"; } from "../actions/queuesActions";
import { import {
BATCH_DELETE_DEAD_TASKS_SUCCESS, BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
BATCH_DELETE_RETRY_TASKS_SUCCESS, BATCH_DELETE_RETRY_TASKS_SUCCESS,
BATCH_DELETE_SCHEDULED_TASKS_SUCCESS, BATCH_DELETE_SCHEDULED_TASKS_SUCCESS,
BATCH_KILL_RETRY_TASKS_SUCCESS, BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
BATCH_KILL_SCHEDULED_TASKS_SUCCESS, BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
BATCH_RUN_DEAD_TASKS_SUCCESS, BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
BATCH_RUN_RETRY_TASKS_SUCCESS, BATCH_RUN_RETRY_TASKS_SUCCESS,
BATCH_RUN_SCHEDULED_TASKS_SUCCESS, BATCH_RUN_SCHEDULED_TASKS_SUCCESS,
DELETE_ALL_DEAD_TASKS_SUCCESS, DELETE_ALL_ARCHIVED_TASKS_SUCCESS,
DELETE_ALL_RETRY_TASKS_SUCCESS, DELETE_ALL_RETRY_TASKS_SUCCESS,
DELETE_ALL_SCHEDULED_TASKS_SUCCESS, DELETE_ALL_SCHEDULED_TASKS_SUCCESS,
DELETE_DEAD_TASK_SUCCESS, DELETE_ARCHIVED_TASK_SUCCESS,
DELETE_RETRY_TASK_SUCCESS, DELETE_RETRY_TASK_SUCCESS,
DELETE_SCHEDULED_TASK_SUCCESS, DELETE_SCHEDULED_TASK_SUCCESS,
KILL_ALL_RETRY_TASKS_SUCCESS, ARCHIVE_ALL_RETRY_TASKS_SUCCESS,
KILL_ALL_SCHEDULED_TASKS_SUCCESS, ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS,
KILL_RETRY_TASK_SUCCESS, ARCHIVE_RETRY_TASK_SUCCESS,
KILL_SCHEDULED_TASK_SUCCESS, ARCHIVE_SCHEDULED_TASK_SUCCESS,
LIST_ACTIVE_TASKS_SUCCESS, LIST_ACTIVE_TASKS_SUCCESS,
LIST_DEAD_TASKS_SUCCESS, LIST_ARCHIVED_TASKS_SUCCESS,
LIST_PENDING_TASKS_SUCCESS, LIST_PENDING_TASKS_SUCCESS,
LIST_RETRY_TASKS_SUCCESS, LIST_RETRY_TASKS_SUCCESS,
LIST_SCHEDULED_TASKS_SUCCESS, LIST_SCHEDULED_TASKS_SUCCESS,
RUN_ALL_DEAD_TASKS_SUCCESS, RUN_ALL_ARCHIVED_TASKS_SUCCESS,
RUN_ALL_RETRY_TASKS_SUCCESS, RUN_ALL_RETRY_TASKS_SUCCESS,
RUN_ALL_SCHEDULED_TASKS_SUCCESS, RUN_ALL_SCHEDULED_TASKS_SUCCESS,
RUN_DEAD_TASK_SUCCESS, RUN_ARCHIVED_TASK_SUCCESS,
RUN_RETRY_TASK_SUCCESS, RUN_RETRY_TASK_SUCCESS,
RUN_SCHEDULED_TASK_SUCCESS, RUN_SCHEDULED_TASK_SUCCESS,
TasksActionTypes, TasksActionTypes,
@ -155,7 +155,7 @@ function queuesReducer(
case LIST_PENDING_TASKS_SUCCESS: case LIST_PENDING_TASKS_SUCCESS:
case LIST_SCHEDULED_TASKS_SUCCESS: case LIST_SCHEDULED_TASKS_SUCCESS:
case LIST_RETRY_TASKS_SUCCESS: case LIST_RETRY_TASKS_SUCCESS:
case LIST_DEAD_TASKS_SUCCESS: { case LIST_ARCHIVED_TASKS_SUCCESS: {
const newData = state.data const newData = state.data
.filter((queueInfo) => queueInfo.name !== action.queue) .filter((queueInfo) => queueInfo.name !== action.queue)
.concat({ .concat({
@ -200,7 +200,7 @@ function queuesReducer(
return { ...state, data: newData }; return { ...state, data: newData };
} }
case RUN_DEAD_TASK_SUCCESS: { case RUN_ARCHIVED_TASK_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -210,14 +210,14 @@ function queuesReducer(
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
pending: queueInfo.currentStats.pending + 1, pending: queueInfo.currentStats.pending + 1,
dead: queueInfo.currentStats.dead - 1, archived: queueInfo.currentStats.archived - 1,
}, },
}; };
}); });
return { ...state, data: newData }; return { ...state, data: newData };
} }
case KILL_SCHEDULED_TASK_SUCCESS: { case ARCHIVE_SCHEDULED_TASK_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -226,7 +226,7 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: queueInfo.currentStats.dead + 1, archived: queueInfo.currentStats.archived + 1,
scheduled: queueInfo.currentStats.scheduled - 1, scheduled: queueInfo.currentStats.scheduled - 1,
}, },
}; };
@ -234,7 +234,7 @@ function queuesReducer(
return { ...state, data: newData }; return { ...state, data: newData };
} }
case KILL_RETRY_TASK_SUCCESS: { case ARCHIVE_RETRY_TASK_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -243,7 +243,7 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: queueInfo.currentStats.dead + 1, archived: queueInfo.currentStats.archived + 1,
retry: queueInfo.currentStats.retry - 1, retry: queueInfo.currentStats.retry - 1,
}, },
}; };
@ -288,7 +288,7 @@ function queuesReducer(
return { ...state, data: newData }; return { ...state, data: newData };
} }
case BATCH_KILL_SCHEDULED_TASKS_SUCCESS: { case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -297,10 +297,12 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: queueInfo.currentStats.dead + action.payload.dead_keys.length, archived:
queueInfo.currentStats.archived +
action.payload.archived_keys.length,
scheduled: scheduled:
queueInfo.currentStats.scheduled - queueInfo.currentStats.scheduled -
action.payload.dead_keys.length, action.payload.archived_keys.length,
}, },
}; };
}); });
@ -343,7 +345,7 @@ function queuesReducer(
return { ...state, data: newData }; return { ...state, data: newData };
} }
case KILL_ALL_SCHEDULED_TASKS_SUCCESS: { case ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -352,8 +354,9 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: archived:
queueInfo.currentStats.dead + queueInfo.currentStats.scheduled, queueInfo.currentStats.archived +
queueInfo.currentStats.scheduled,
scheduled: 0, scheduled: 0,
}, },
}; };
@ -413,7 +416,7 @@ function queuesReducer(
return { ...state, data: newData }; return { ...state, data: newData };
} }
case BATCH_KILL_RETRY_TASKS_SUCCESS: { case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -422,10 +425,12 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: archived:
queueInfo.currentStats.pending + action.payload.dead_keys.length, queueInfo.currentStats.pending +
action.payload.archived_keys.length,
retry: 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 }; return { ...state, data: newData };
} }
case KILL_ALL_RETRY_TASKS_SUCCESS: { case ARCHIVE_ALL_RETRY_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -476,7 +481,8 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: queueInfo.currentStats.dead + queueInfo.currentStats.retry, archived:
queueInfo.currentStats.archived + queueInfo.currentStats.retry,
retry: 0, retry: 0,
}, },
}; };
@ -500,7 +506,7 @@ function queuesReducer(
return { ...state, data: newData }; return { ...state, data: newData };
} }
case DELETE_DEAD_TASK_SUCCESS: { case DELETE_ARCHIVED_TASK_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -509,14 +515,14 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: queueInfo.currentStats.dead - 1, archived: queueInfo.currentStats.archived - 1,
}, },
}; };
}); });
return { ...state, data: newData }; return { ...state, data: newData };
} }
case BATCH_RUN_DEAD_TASKS_SUCCESS: { case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -528,15 +534,16 @@ function queuesReducer(
pending: pending:
queueInfo.currentStats.pending + queueInfo.currentStats.pending +
action.payload.pending_keys.length, action.payload.pending_keys.length,
dead: archived:
queueInfo.currentStats.dead - action.payload.pending_keys.length, queueInfo.currentStats.archived -
action.payload.pending_keys.length,
}, },
}; };
}); });
return { ...state, data: newData }; return { ...state, data: newData };
} }
case BATCH_DELETE_DEAD_TASKS_SUCCESS: { case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -545,15 +552,16 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: archived:
queueInfo.currentStats.dead - action.payload.deleted_keys.length, queueInfo.currentStats.archived -
action.payload.deleted_keys.length,
}, },
}; };
}); });
return { ...state, data: newData }; return { ...state, data: newData };
} }
case RUN_ALL_DEAD_TASKS_SUCCESS: { case RUN_ALL_ARCHIVED_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -563,15 +571,15 @@ function queuesReducer(
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
pending: pending:
queueInfo.currentStats.pending + queueInfo.currentStats.dead, queueInfo.currentStats.pending + queueInfo.currentStats.archived,
dead: 0, archived: 0,
}, },
}; };
}); });
return { ...state, data: newData }; return { ...state, data: newData };
} }
case DELETE_ALL_DEAD_TASKS_SUCCESS: { case DELETE_ALL_ARCHIVED_TASKS_SUCCESS: {
const newData = state.data.map((queueInfo) => { const newData = state.data.map((queueInfo) => {
if (queueInfo.name !== action.queue) { if (queueInfo.name !== action.queue) {
return queueInfo; return queueInfo;
@ -580,7 +588,7 @@ function queuesReducer(
...queueInfo, ...queueInfo,
currentStats: { currentStats: {
...queueInfo.currentStats, ...queueInfo.currentStats,
dead: 0, archived: 0,
}, },
}; };
}); });

View File

@ -4,29 +4,29 @@ import {
} from "../actions/snackbarActions"; } from "../actions/snackbarActions";
import { import {
BATCH_CANCEL_ACTIVE_TASKS_SUCCESS, BATCH_CANCEL_ACTIVE_TASKS_SUCCESS,
BATCH_DELETE_DEAD_TASKS_SUCCESS, BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
BATCH_DELETE_RETRY_TASKS_SUCCESS, BATCH_DELETE_RETRY_TASKS_SUCCESS,
BATCH_DELETE_SCHEDULED_TASKS_SUCCESS, BATCH_DELETE_SCHEDULED_TASKS_SUCCESS,
BATCH_KILL_RETRY_TASKS_SUCCESS, BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
BATCH_KILL_SCHEDULED_TASKS_SUCCESS, BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
BATCH_RUN_DEAD_TASKS_SUCCESS, BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
BATCH_RUN_RETRY_TASKS_SUCCESS, BATCH_RUN_RETRY_TASKS_SUCCESS,
BATCH_RUN_SCHEDULED_TASKS_SUCCESS, BATCH_RUN_SCHEDULED_TASKS_SUCCESS,
CANCEL_ALL_ACTIVE_TASKS_SUCCESS, CANCEL_ALL_ACTIVE_TASKS_SUCCESS,
DELETE_ALL_DEAD_TASKS_SUCCESS, DELETE_ALL_ARCHIVED_TASKS_SUCCESS,
DELETE_ALL_RETRY_TASKS_SUCCESS, DELETE_ALL_RETRY_TASKS_SUCCESS,
DELETE_ALL_SCHEDULED_TASKS_SUCCESS, DELETE_ALL_SCHEDULED_TASKS_SUCCESS,
DELETE_DEAD_TASK_SUCCESS, DELETE_ARCHIVED_TASK_SUCCESS,
DELETE_RETRY_TASK_SUCCESS, DELETE_RETRY_TASK_SUCCESS,
DELETE_SCHEDULED_TASK_SUCCESS, DELETE_SCHEDULED_TASK_SUCCESS,
KILL_ALL_RETRY_TASKS_SUCCESS, ARCHIVE_ALL_RETRY_TASKS_SUCCESS,
KILL_ALL_SCHEDULED_TASKS_SUCCESS, ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS,
KILL_RETRY_TASK_SUCCESS, ARCHIVE_RETRY_TASK_SUCCESS,
KILL_SCHEDULED_TASK_SUCCESS, ARCHIVE_SCHEDULED_TASK_SUCCESS,
RUN_ALL_DEAD_TASKS_SUCCESS, RUN_ALL_ARCHIVED_TASKS_SUCCESS,
RUN_ALL_RETRY_TASKS_SUCCESS, RUN_ALL_RETRY_TASKS_SUCCESS,
RUN_ALL_SCHEDULED_TASKS_SUCCESS, RUN_ALL_SCHEDULED_TASKS_SUCCESS,
RUN_DEAD_TASK_SUCCESS, RUN_ARCHIVED_TASK_SUCCESS,
RUN_RETRY_TASK_SUCCESS, RUN_RETRY_TASK_SUCCESS,
RUN_SCHEDULED_TASK_SUCCESS, RUN_SCHEDULED_TASK_SUCCESS,
TasksActionTypes, TasksActionTypes,
@ -83,22 +83,22 @@ function snackbarReducer(
message: `Retry task is now pending`, message: `Retry task is now pending`,
}; };
case RUN_DEAD_TASK_SUCCESS: case RUN_ARCHIVED_TASK_SUCCESS:
return { return {
isOpen: true, 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 { return {
isOpen: true, 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 { return {
isOpen: true, isOpen: true,
message: `Retry task is now dead`, message: `Retry task is now archived`,
}; };
case DELETE_SCHEDULED_TASK_SUCCESS: case DELETE_SCHEDULED_TASK_SUCCESS:
@ -117,11 +117,13 @@ function snackbarReducer(
}; };
} }
case BATCH_KILL_SCHEDULED_TASKS_SUCCESS: { case BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS: {
const n = action.payload.dead_keys.length; const n = action.payload.archived_keys.length;
return { return {
isOpen: true, 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", message: "All scheduled tasks are now pending",
}; };
case KILL_ALL_SCHEDULED_TASKS_SUCCESS: case ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS:
return { return {
isOpen: true, isOpen: true,
message: "All scheduled tasks are now dead", message: "All scheduled tasks are now archived",
}; };
case DELETE_ALL_SCHEDULED_TASKS_SUCCESS: case DELETE_ALL_SCHEDULED_TASKS_SUCCESS:
@ -165,11 +167,11 @@ function snackbarReducer(
}; };
} }
case BATCH_KILL_RETRY_TASKS_SUCCESS: { case BATCH_ARCHIVE_RETRY_TASKS_SUCCESS: {
const n = action.payload.dead_keys.length; const n = action.payload.archived_keys.length;
return { return {
isOpen: true, 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", message: "All retry tasks are now pending",
}; };
case KILL_ALL_RETRY_TASKS_SUCCESS: case ARCHIVE_ALL_RETRY_TASKS_SUCCESS:
return { return {
isOpen: true, isOpen: true,
message: "All retry tasks are now dead", message: "All retry tasks are now archived",
}; };
case DELETE_ALL_RETRY_TASKS_SUCCESS: case DELETE_ALL_RETRY_TASKS_SUCCESS:
@ -199,38 +201,40 @@ function snackbarReducer(
message: "All retry tasks deleted", message: "All retry tasks deleted",
}; };
case DELETE_DEAD_TASK_SUCCESS: case DELETE_ARCHIVED_TASK_SUCCESS:
return { return {
isOpen: true, 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; const n = action.payload.pending_keys.length;
return { return {
isOpen: true, 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; const n = action.payload.deleted_keys.length;
return { return {
isOpen: true, 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 { return {
isOpen: true, 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 { return {
isOpen: true, isOpen: true,
message: "All dead tasks deleted", message: "All archived tasks deleted",
}; };
default: default:

View File

@ -12,9 +12,9 @@ import {
LIST_RETRY_TASKS_BEGIN, LIST_RETRY_TASKS_BEGIN,
LIST_RETRY_TASKS_SUCCESS, LIST_RETRY_TASKS_SUCCESS,
LIST_RETRY_TASKS_ERROR, LIST_RETRY_TASKS_ERROR,
LIST_DEAD_TASKS_BEGIN, LIST_ARCHIVED_TASKS_BEGIN,
LIST_DEAD_TASKS_SUCCESS, LIST_ARCHIVED_TASKS_SUCCESS,
LIST_DEAD_TASKS_ERROR, LIST_ARCHIVED_TASKS_ERROR,
CANCEL_ACTIVE_TASK_BEGIN, CANCEL_ACTIVE_TASK_BEGIN,
CANCEL_ACTIVE_TASK_SUCCESS, CANCEL_ACTIVE_TASK_SUCCESS,
CANCEL_ACTIVE_TASK_ERROR, CANCEL_ACTIVE_TASK_ERROR,
@ -24,24 +24,24 @@ import {
DELETE_SCHEDULED_TASK_BEGIN, DELETE_SCHEDULED_TASK_BEGIN,
DELETE_SCHEDULED_TASK_SUCCESS, DELETE_SCHEDULED_TASK_SUCCESS,
DELETE_SCHEDULED_TASK_ERROR, DELETE_SCHEDULED_TASK_ERROR,
DELETE_DEAD_TASK_BEGIN, DELETE_ARCHIVED_TASK_BEGIN,
DELETE_DEAD_TASK_SUCCESS, DELETE_ARCHIVED_TASK_SUCCESS,
DELETE_DEAD_TASK_ERROR, DELETE_ARCHIVED_TASK_ERROR,
BATCH_DELETE_DEAD_TASKS_BEGIN, BATCH_DELETE_ARCHIVED_TASKS_BEGIN,
BATCH_DELETE_DEAD_TASKS_SUCCESS, BATCH_DELETE_ARCHIVED_TASKS_SUCCESS,
BATCH_DELETE_DEAD_TASKS_ERROR, BATCH_DELETE_ARCHIVED_TASKS_ERROR,
RUN_DEAD_TASK_BEGIN, RUN_ARCHIVED_TASK_BEGIN,
RUN_DEAD_TASK_SUCCESS, RUN_ARCHIVED_TASK_SUCCESS,
RUN_DEAD_TASK_ERROR, RUN_ARCHIVED_TASK_ERROR,
BATCH_RUN_DEAD_TASKS_BEGIN, BATCH_RUN_ARCHIVED_TASKS_BEGIN,
BATCH_RUN_DEAD_TASKS_ERROR, BATCH_RUN_ARCHIVED_TASKS_ERROR,
BATCH_RUN_DEAD_TASKS_SUCCESS, BATCH_RUN_ARCHIVED_TASKS_SUCCESS,
DELETE_ALL_DEAD_TASKS_BEGIN, DELETE_ALL_ARCHIVED_TASKS_BEGIN,
DELETE_ALL_DEAD_TASKS_SUCCESS, DELETE_ALL_ARCHIVED_TASKS_SUCCESS,
DELETE_ALL_DEAD_TASKS_ERROR, DELETE_ALL_ARCHIVED_TASKS_ERROR,
RUN_ALL_DEAD_TASKS_BEGIN, RUN_ALL_ARCHIVED_TASKS_BEGIN,
RUN_ALL_DEAD_TASKS_ERROR, RUN_ALL_ARCHIVED_TASKS_ERROR,
RUN_ALL_DEAD_TASKS_SUCCESS, RUN_ALL_ARCHIVED_TASKS_SUCCESS,
BATCH_DELETE_RETRY_TASKS_ERROR, BATCH_DELETE_RETRY_TASKS_ERROR,
BATCH_RUN_RETRY_TASKS_ERROR, BATCH_RUN_RETRY_TASKS_ERROR,
BATCH_DELETE_RETRY_TASKS_SUCCESS, BATCH_DELETE_RETRY_TASKS_SUCCESS,
@ -72,24 +72,24 @@ import {
RUN_SCHEDULED_TASK_BEGIN, RUN_SCHEDULED_TASK_BEGIN,
RUN_SCHEDULED_TASK_SUCCESS, RUN_SCHEDULED_TASK_SUCCESS,
RUN_SCHEDULED_TASK_ERROR, RUN_SCHEDULED_TASK_ERROR,
KILL_SCHEDULED_TASK_BEGIN, ARCHIVE_SCHEDULED_TASK_BEGIN,
KILL_SCHEDULED_TASK_SUCCESS, ARCHIVE_SCHEDULED_TASK_SUCCESS,
KILL_SCHEDULED_TASK_ERROR, ARCHIVE_SCHEDULED_TASK_ERROR,
KILL_ALL_SCHEDULED_TASKS_BEGIN, ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN,
KILL_ALL_SCHEDULED_TASKS_SUCCESS, ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS,
KILL_ALL_SCHEDULED_TASKS_ERROR, ARCHIVE_ALL_SCHEDULED_TASKS_ERROR,
BATCH_KILL_SCHEDULED_TASKS_BEGIN, BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN,
BATCH_KILL_SCHEDULED_TASKS_ERROR, BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR,
BATCH_KILL_SCHEDULED_TASKS_SUCCESS, BATCH_ARCHIVE_SCHEDULED_TASKS_SUCCESS,
KILL_RETRY_TASK_BEGIN, ARCHIVE_RETRY_TASK_BEGIN,
KILL_RETRY_TASK_SUCCESS, ARCHIVE_RETRY_TASK_SUCCESS,
KILL_RETRY_TASK_ERROR, ARCHIVE_RETRY_TASK_ERROR,
KILL_ALL_RETRY_TASKS_BEGIN, ARCHIVE_ALL_RETRY_TASKS_BEGIN,
KILL_ALL_RETRY_TASKS_SUCCESS, ARCHIVE_ALL_RETRY_TASKS_SUCCESS,
KILL_ALL_RETRY_TASKS_ERROR, ARCHIVE_ALL_RETRY_TASKS_ERROR,
BATCH_KILL_RETRY_TASKS_SUCCESS, BATCH_ARCHIVE_RETRY_TASKS_SUCCESS,
BATCH_KILL_RETRY_TASKS_BEGIN, BATCH_ARCHIVE_RETRY_TASKS_BEGIN,
BATCH_KILL_RETRY_TASKS_ERROR, BATCH_ARCHIVE_RETRY_TASKS_ERROR,
BATCH_CANCEL_ACTIVE_TASKS_BEGIN, BATCH_CANCEL_ACTIVE_TASKS_BEGIN,
BATCH_CANCEL_ACTIVE_TASKS_SUCCESS, BATCH_CANCEL_ACTIVE_TASKS_SUCCESS,
BATCH_CANCEL_ACTIVE_TASKS_ERROR, BATCH_CANCEL_ACTIVE_TASKS_ERROR,
@ -99,7 +99,7 @@ import {
} from "../actions/tasksActions"; } from "../actions/tasksActions";
import { import {
ActiveTask, ActiveTask,
DeadTask, ArchivedTask,
PendingTask, PendingTask,
RetryTask, RetryTask,
ScheduledTask, ScheduledTask,
@ -127,7 +127,7 @@ export interface RetryTaskExtended extends RetryTask {
requestPending: boolean; requestPending: boolean;
} }
export interface DeadTaskExtended extends DeadTask { export interface ArchivedTaskExtended extends ArchivedTask {
// Indicates that a request has been sent for this // Indicates that a request has been sent for this
// task and awaiting for a response. // task and awaiting for a response.
requestPending: boolean; requestPending: boolean;
@ -160,12 +160,12 @@ interface TasksState {
error: string; error: string;
data: RetryTaskExtended[]; data: RetryTaskExtended[];
}; };
deadTasks: { archivedTasks: {
loading: boolean; loading: boolean;
batchActionPending: boolean; batchActionPending: boolean;
allActionPending: boolean; allActionPending: boolean;
error: string; error: string;
data: DeadTaskExtended[]; data: ArchivedTaskExtended[];
}; };
} }
@ -196,7 +196,7 @@ const initialState: TasksState = {
error: "", error: "",
data: [], data: [],
}, },
deadTasks: { archivedTasks: {
loading: false, loading: false,
batchActionPending: false, batchActionPending: false,
allActionPending: false, allActionPending: false,
@ -343,21 +343,21 @@ function tasksReducer(
}, },
}; };
case LIST_DEAD_TASKS_BEGIN: case LIST_ARCHIVED_TASKS_BEGIN:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
error: "", error: "",
loading: true, loading: true,
}, },
}; };
case LIST_DEAD_TASKS_SUCCESS: case LIST_ARCHIVED_TASKS_SUCCESS:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
loading: false, loading: false,
error: "", error: "",
data: action.payload.tasks.map((task) => ({ data: action.payload.tasks.map((task) => ({
@ -367,11 +367,11 @@ function tasksReducer(
}, },
}; };
case LIST_DEAD_TASKS_ERROR: case LIST_ARCHIVED_TASKS_ERROR:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
loading: false, loading: false,
error: action.error, error: action.error,
}, },
@ -522,7 +522,7 @@ function tasksReducer(
} }
case RUN_SCHEDULED_TASK_BEGIN: case RUN_SCHEDULED_TASK_BEGIN:
case KILL_SCHEDULED_TASK_BEGIN: case ARCHIVE_SCHEDULED_TASK_BEGIN:
case DELETE_SCHEDULED_TASK_BEGIN: case DELETE_SCHEDULED_TASK_BEGIN:
return { return {
...state, ...state,
@ -538,7 +538,7 @@ function tasksReducer(
}; };
case RUN_SCHEDULED_TASK_SUCCESS: case RUN_SCHEDULED_TASK_SUCCESS:
case KILL_SCHEDULED_TASK_SUCCESS: case ARCHIVE_SCHEDULED_TASK_SUCCESS:
case DELETE_SCHEDULED_TASK_SUCCESS: case DELETE_SCHEDULED_TASK_SUCCESS:
return { return {
...state, ...state,
@ -551,7 +551,7 @@ function tasksReducer(
}; };
case RUN_SCHEDULED_TASK_ERROR: case RUN_SCHEDULED_TASK_ERROR:
case KILL_SCHEDULED_TASK_ERROR: case ARCHIVE_SCHEDULED_TASK_ERROR:
case DELETE_SCHEDULED_TASK_ERROR: case DELETE_SCHEDULED_TASK_ERROR:
return { return {
...state, ...state,
@ -567,7 +567,7 @@ function tasksReducer(
}; };
case RUN_ALL_SCHEDULED_TASKS_BEGIN: case RUN_ALL_SCHEDULED_TASKS_BEGIN:
case KILL_ALL_SCHEDULED_TASKS_BEGIN: case ARCHIVE_ALL_SCHEDULED_TASKS_BEGIN:
case DELETE_ALL_SCHEDULED_TASKS_BEGIN: case DELETE_ALL_SCHEDULED_TASKS_BEGIN:
return { return {
...state, ...state,
@ -578,7 +578,7 @@ function tasksReducer(
}; };
case RUN_ALL_SCHEDULED_TASKS_SUCCESS: case RUN_ALL_SCHEDULED_TASKS_SUCCESS:
case KILL_ALL_SCHEDULED_TASKS_SUCCESS: case ARCHIVE_ALL_SCHEDULED_TASKS_SUCCESS:
case DELETE_ALL_SCHEDULED_TASKS_SUCCESS: case DELETE_ALL_SCHEDULED_TASKS_SUCCESS:
return { return {
...state, ...state,
@ -590,7 +590,7 @@ function tasksReducer(
}; };
case RUN_ALL_SCHEDULED_TASKS_ERROR: case RUN_ALL_SCHEDULED_TASKS_ERROR:
case KILL_ALL_SCHEDULED_TASKS_ERROR: case ARCHIVE_ALL_SCHEDULED_TASKS_ERROR:
case DELETE_ALL_SCHEDULED_TASKS_ERROR: case DELETE_ALL_SCHEDULED_TASKS_ERROR:
return { return {
...state, ...state,
@ -601,7 +601,7 @@ function tasksReducer(
}; };
case BATCH_RUN_SCHEDULED_TASKS_BEGIN: case BATCH_RUN_SCHEDULED_TASKS_BEGIN:
case BATCH_KILL_SCHEDULED_TASKS_BEGIN: case BATCH_ARCHIVE_SCHEDULED_TASKS_BEGIN:
case BATCH_DELETE_SCHEDULED_TASKS_BEGIN: case BATCH_DELETE_SCHEDULED_TASKS_BEGIN:
return { return {
...state, ...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( const newData = state.scheduledTasks.data.filter(
(task) => !action.payload.dead_keys.includes(task.key) (task) => !action.payload.archived_keys.includes(task.key)
); );
return { return {
...state, ...state,
@ -663,7 +663,7 @@ function tasksReducer(
} }
case BATCH_RUN_SCHEDULED_TASKS_ERROR: case BATCH_RUN_SCHEDULED_TASKS_ERROR:
case BATCH_KILL_SCHEDULED_TASKS_ERROR: case BATCH_ARCHIVE_SCHEDULED_TASKS_ERROR:
case BATCH_DELETE_SCHEDULED_TASKS_ERROR: case BATCH_DELETE_SCHEDULED_TASKS_ERROR:
return { return {
...state, ...state,
@ -683,7 +683,7 @@ function tasksReducer(
}; };
case RUN_RETRY_TASK_BEGIN: case RUN_RETRY_TASK_BEGIN:
case KILL_RETRY_TASK_BEGIN: case ARCHIVE_RETRY_TASK_BEGIN:
case DELETE_RETRY_TASK_BEGIN: case DELETE_RETRY_TASK_BEGIN:
return { return {
...state, ...state,
@ -699,7 +699,7 @@ function tasksReducer(
}; };
case RUN_RETRY_TASK_SUCCESS: case RUN_RETRY_TASK_SUCCESS:
case KILL_RETRY_TASK_SUCCESS: case ARCHIVE_RETRY_TASK_SUCCESS:
case DELETE_RETRY_TASK_SUCCESS: case DELETE_RETRY_TASK_SUCCESS:
return { return {
...state, ...state,
@ -712,7 +712,7 @@ function tasksReducer(
}; };
case RUN_RETRY_TASK_ERROR: case RUN_RETRY_TASK_ERROR:
case KILL_RETRY_TASK_ERROR: case ARCHIVE_RETRY_TASK_ERROR:
case DELETE_RETRY_TASK_ERROR: case DELETE_RETRY_TASK_ERROR:
return { return {
...state, ...state,
@ -728,7 +728,7 @@ function tasksReducer(
}; };
case RUN_ALL_RETRY_TASKS_BEGIN: case RUN_ALL_RETRY_TASKS_BEGIN:
case KILL_ALL_RETRY_TASKS_BEGIN: case ARCHIVE_ALL_RETRY_TASKS_BEGIN:
case DELETE_ALL_RETRY_TASKS_BEGIN: case DELETE_ALL_RETRY_TASKS_BEGIN:
return { return {
...state, ...state,
@ -739,7 +739,7 @@ function tasksReducer(
}; };
case RUN_ALL_RETRY_TASKS_SUCCESS: case RUN_ALL_RETRY_TASKS_SUCCESS:
case KILL_ALL_RETRY_TASKS_SUCCESS: case ARCHIVE_ALL_RETRY_TASKS_SUCCESS:
case DELETE_ALL_RETRY_TASKS_SUCCESS: case DELETE_ALL_RETRY_TASKS_SUCCESS:
return { return {
...state, ...state,
@ -751,7 +751,7 @@ function tasksReducer(
}; };
case RUN_ALL_RETRY_TASKS_ERROR: case RUN_ALL_RETRY_TASKS_ERROR:
case KILL_ALL_RETRY_TASKS_ERROR: case ARCHIVE_ALL_RETRY_TASKS_ERROR:
case DELETE_ALL_RETRY_TASKS_ERROR: case DELETE_ALL_RETRY_TASKS_ERROR:
return { return {
...state, ...state,
@ -762,7 +762,7 @@ function tasksReducer(
}; };
case BATCH_RUN_RETRY_TASKS_BEGIN: case BATCH_RUN_RETRY_TASKS_BEGIN:
case BATCH_KILL_RETRY_TASKS_BEGIN: case BATCH_ARCHIVE_RETRY_TASKS_BEGIN:
case BATCH_DELETE_RETRY_TASKS_BEGIN: case BATCH_DELETE_RETRY_TASKS_BEGIN:
return { return {
...state, ...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( const newData = state.retryTasks.data.filter(
(task) => !action.payload.dead_keys.includes(task.key) (task) => !action.payload.archived_keys.includes(task.key)
); );
return { return {
...state, ...state,
@ -824,7 +824,7 @@ function tasksReducer(
} }
case BATCH_RUN_RETRY_TASKS_ERROR: case BATCH_RUN_RETRY_TASKS_ERROR:
case BATCH_KILL_RETRY_TASKS_ERROR: case BATCH_ARCHIVE_RETRY_TASKS_ERROR:
case BATCH_DELETE_RETRY_TASKS_ERROR: case BATCH_DELETE_RETRY_TASKS_ERROR:
return { return {
...state, ...state,
@ -843,13 +843,13 @@ function tasksReducer(
}, },
}; };
case RUN_DEAD_TASK_BEGIN: case RUN_ARCHIVED_TASK_BEGIN:
case DELETE_DEAD_TASK_BEGIN: case DELETE_ARCHIVED_TASK_BEGIN:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
data: state.deadTasks.data.map((task) => { data: state.archivedTasks.data.map((task) => {
if (task.key !== action.taskKey) { if (task.key !== action.taskKey) {
return task; return task;
} }
@ -858,25 +858,25 @@ function tasksReducer(
}, },
}; };
case RUN_DEAD_TASK_SUCCESS: case RUN_ARCHIVED_TASK_SUCCESS:
case DELETE_DEAD_TASK_SUCCESS: case DELETE_ARCHIVED_TASK_SUCCESS:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
data: state.deadTasks.data.filter( data: state.archivedTasks.data.filter(
(task) => task.key !== action.taskKey (task) => task.key !== action.taskKey
), ),
}, },
}; };
case RUN_DEAD_TASK_ERROR: case RUN_ARCHIVED_TASK_ERROR:
case DELETE_DEAD_TASK_ERROR: case DELETE_ARCHIVED_TASK_ERROR:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
data: state.deadTasks.data.map((task) => { data: state.archivedTasks.data.map((task) => {
if (task.key !== action.taskKey) { if (task.key !== action.taskKey) {
return task; return task;
} }
@ -885,45 +885,45 @@ function tasksReducer(
}, },
}; };
case RUN_ALL_DEAD_TASKS_BEGIN: case RUN_ALL_ARCHIVED_TASKS_BEGIN:
case DELETE_ALL_DEAD_TASKS_BEGIN: case DELETE_ALL_ARCHIVED_TASKS_BEGIN:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
allActionPending: true, allActionPending: true,
}, },
}; };
case RUN_ALL_DEAD_TASKS_SUCCESS: case RUN_ALL_ARCHIVED_TASKS_SUCCESS:
case DELETE_ALL_DEAD_TASKS_SUCCESS: case DELETE_ALL_ARCHIVED_TASKS_SUCCESS:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
allActionPending: false, allActionPending: false,
data: [], data: [],
}, },
}; };
case RUN_ALL_DEAD_TASKS_ERROR: case RUN_ALL_ARCHIVED_TASKS_ERROR:
case DELETE_ALL_DEAD_TASKS_ERROR: case DELETE_ALL_ARCHIVED_TASKS_ERROR:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
allActionPending: false, allActionPending: false,
}, },
}; };
case BATCH_RUN_DEAD_TASKS_BEGIN: case BATCH_RUN_ARCHIVED_TASKS_BEGIN:
case BATCH_DELETE_DEAD_TASKS_BEGIN: case BATCH_DELETE_ARCHIVED_TASKS_BEGIN:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
batchActionPending: true, batchActionPending: true,
data: state.deadTasks.data.map((task) => { data: state.archivedTasks.data.map((task) => {
if (!action.taskKeys.includes(task.key)) { if (!action.taskKeys.includes(task.key)) {
return task; return task;
} }
@ -935,42 +935,42 @@ function tasksReducer(
}, },
}; };
case BATCH_RUN_DEAD_TASKS_SUCCESS: { case BATCH_RUN_ARCHIVED_TASKS_SUCCESS: {
const newData = state.deadTasks.data.filter( const newData = state.archivedTasks.data.filter(
(task) => !action.payload.pending_keys.includes(task.key) (task) => !action.payload.pending_keys.includes(task.key)
); );
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
batchActionPending: false, batchActionPending: false,
data: newData, data: newData,
}, },
}; };
} }
case BATCH_DELETE_DEAD_TASKS_SUCCESS: { case BATCH_DELETE_ARCHIVED_TASKS_SUCCESS: {
const newData = state.deadTasks.data.filter( const newData = state.archivedTasks.data.filter(
(task) => !action.payload.deleted_keys.includes(task.key) (task) => !action.payload.deleted_keys.includes(task.key)
); );
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
batchActionPending: false, batchActionPending: false,
data: newData, data: newData,
}, },
}; };
} }
case BATCH_RUN_DEAD_TASKS_ERROR: case BATCH_RUN_ARCHIVED_TASKS_ERROR:
case BATCH_DELETE_DEAD_TASKS_ERROR: case BATCH_DELETE_ARCHIVED_TASKS_ERROR:
return { return {
...state, ...state,
deadTasks: { archivedTasks: {
...state.deadTasks, ...state.archivedTasks,
batchActionPending: false, batchActionPending: false,
data: state.deadTasks.data.map((task) => { data: state.archivedTasks.data.map((task) => {
if (!action.taskKeys.includes(task.key)) { if (!action.taskKeys.includes(task.key)) {
return task; return task;
} }

View File

@ -155,8 +155,8 @@ function DashboardView(props: Props) {
retried in the future retried in the future
</div> </div>
<div> <div>
<strong>Dead</strong>: number of tasks exhausted their <strong>Archived</strong>: number of tasks exhausted
retries their retries
</div> </div>
</div> </div>
} }

View File

@ -29,7 +29,7 @@ interface RouteParams {
qname: string; qname: string;
} }
const validStatus = ["active", "pending", "scheduled", "retry", "dead"]; const validStatus = ["active", "pending", "scheduled", "retry", "archived"];
const defaultStatus = "active"; const defaultStatus = "active";
function TasksView() { function TasksView() {

View File

@ -1409,7 +1409,7 @@
"@material-ui/icons@4.9.1": "@material-ui/icons@4.9.1":
version "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== integrity sha512-GBitL3oBWO0hzBhvA9KxqcowRUsA0qzwKkURyC8nppnC3fw54KPKZ+d4V1Eeg/UnDRSzDaI9nGCdel/eh9AQMg==
dependencies: dependencies:
"@babel/runtime" "^7.4.4" "@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" array-includes "^3.0.3"
object.assign "^4.1.0" object.assign "^4.1.0"
killable@^1.0.1: archiveable@^1.0.1:
version "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== integrity sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==
kind-of@^2.0.1: kind-of@^2.0.1:
@ -11459,7 +11459,7 @@ webpack-dev-server@3.11.0:
internal-ip "^4.3.0" internal-ip "^4.3.0"
ip "^1.1.5" ip "^1.1.5"
is-absolute-url "^3.0.3" is-absolute-url "^3.0.3"
killable "^1.0.1" archiveable "^1.0.1"
loglevel "^1.6.8" loglevel "^1.6.8"
opn "^5.5.0" opn "^5.5.0"
p-retry "^3.0.1" p-retry "^3.0.1"