mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-10-07 20:52:02 +08:00
Add redux actions and reducer for scheduler entries
This commit is contained in:
@@ -37,6 +37,10 @@ export interface ListDeadTasksResponse {
|
||||
stats: Queue;
|
||||
}
|
||||
|
||||
export interface ListSchedulerEntriesResponse {
|
||||
entries: SchedulerEntry[];
|
||||
}
|
||||
|
||||
export interface Queue {
|
||||
queue: string;
|
||||
paused: boolean;
|
||||
@@ -97,6 +101,16 @@ export interface DeadTask extends BaseTask {
|
||||
error_message: string;
|
||||
}
|
||||
|
||||
export interface SchedulerEntry {
|
||||
id: string;
|
||||
spec: string;
|
||||
task_type: string;
|
||||
task_payload: { [key: string]: any };
|
||||
options: string[];
|
||||
next_enqueue_at: string;
|
||||
prev_enqueue_at: string;
|
||||
}
|
||||
|
||||
export interface PaginationOptions extends Record<string, number | undefined> {
|
||||
size?: number; // size of the page
|
||||
page?: number; // page number (1 being the first page)
|
||||
@@ -213,3 +227,11 @@ export async function listDeadTasks(
|
||||
});
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export async function listSchedulerEntries(): Promise<ListSchedulerEntriesResponse> {
|
||||
const resp = await axios({
|
||||
method: "get",
|
||||
url: `${BASE_URL}/scheduler_entries`,
|
||||
});
|
||||
return resp.data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user