Add batch run button to DeadTasksTable

This commit is contained in:
Ken Hibino
2020-12-15 06:46:23 -08:00
parent 706e80580d
commit 9bfd373f85
6 changed files with 132 additions and 5 deletions

View File

@@ -46,6 +46,11 @@ export interface BatchDeleteTasksResponse {
failed_keys: string[];
}
export interface BatchRunTasksResponse {
pending_keys: string[];
error_keys: string[];
}
export interface Queue {
queue: string;
paused: boolean;
@@ -299,7 +304,20 @@ export async function batchDeleteDeadTasks(
task_keys: taskKeys,
},
});
console.log("debug: response:", resp);
return resp.data;
}
export async function batchRunDeadTasks(
qname: string,
taskKeys: string[]
): Promise<BatchRunTasksResponse> {
const resp = await axios({
method: "post",
url: `${BASE_URL}/queues/${qname}/dead_tasks:batch_run`,
data: {
task_keys: taskKeys,
},
});
return resp.data;
}