mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-10-07 20:52:02 +08:00
Add Task details view
Allow users to find task by task ID
This commit is contained in:
@@ -245,6 +245,21 @@ interface BaseTask {
|
||||
payload: string;
|
||||
}
|
||||
|
||||
export interface TaskInfo {
|
||||
id: string;
|
||||
queue: string;
|
||||
type: string;
|
||||
payload: string;
|
||||
state: string;
|
||||
max_retry: number;
|
||||
retried: number;
|
||||
last_failed_at: string;
|
||||
error_message: string;
|
||||
next_process_at: string;
|
||||
timeout_seconds: number;
|
||||
deadline: string;
|
||||
}
|
||||
|
||||
export interface ActiveTask extends BaseTask {
|
||||
id: string;
|
||||
queue: string;
|
||||
@@ -369,6 +384,15 @@ export async function listQueueStats(): Promise<ListQueueStatsResponse> {
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function getTaskInfo(qname: string, id: string): Promise<TaskInfo> {
|
||||
const url = `${BASE_URL}/queues/${qname}/tasks/${id}`;
|
||||
const resp = await axios({
|
||||
method: "get",
|
||||
url,
|
||||
});
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function listActiveTasks(
|
||||
qname: string,
|
||||
pageOpts?: PaginationOptions
|
||||
|
Reference in New Issue
Block a user