Fix stuck Celery tasks and add purge all tasks functionality

This commit is contained in:
Viktor Barzin 2026-02-01 20:40:07 +00:00
parent 93f7f57de3
commit 835a2a9d53
8 changed files with 413 additions and 16 deletions

View file

@ -10,6 +10,12 @@ export interface CancelTaskResponse {
message: string;
}
export interface ClearAllTasksResponse {
success: boolean;
count: number;
message: string;
}
/**
* Fetch all active tasks for the current user
*/
@ -41,3 +47,12 @@ export async function cancelTask(
params: { task_id: taskId },
});
}
/**
* Clear all tasks for the current user
*/
export async function clearAllTasks(user: User): Promise<ClearAllTasksResponse> {
return apiRequest<ClearAllTasksResponse>(user, API_ENDPOINTS.CLEAR_ALL_TASKS, {
method: 'POST',
});
}