api/tasks: rename 'cancel_task' into 'delete_task'

This commit is contained in:
Johannes Kirschbauer
2025-07-07 14:07:53 +02:00
parent cf92303f31
commit c382e8f1f3
3 changed files with 3 additions and 3 deletions

View File

@@ -90,7 +90,7 @@ const handleCancel = async <K extends OperationNames>(
orig_task: Promise<BackendReturnType<K>>,
) => {
console.log("Canceling operation: ", ops_key);
const { promise, op_key } = _callApi("cancel_task", { task_id: ops_key });
const { promise, op_key } = _callApi("delete_task", { task_id: ops_key });
promise.catch((error) => {
toast.custom(
(t) => (

View File

@@ -90,7 +90,7 @@ const handleCancel = async <K extends OperationNames>(
orig_task: Promise<BackendReturnType<K>>,
) => {
console.log("Canceling operation: ", ops_key);
const { promise, op_key } = _callApi("cancel_task", { task_id: ops_key });
const { promise, op_key } = _callApi("delete_task", { task_id: ops_key });
promise.catch((error) => {
toast.custom(
(t) => (

View File

@@ -17,7 +17,7 @@ BAKEND_THREADS: dict[str, WebThread] | None = None
@API.register_abstract
def cancel_task(task_id: str) -> None:
def delete_task(task_id: str) -> None:
"""Cancel a task by its op_key."""
assert BAKEND_THREADS is not None, "Backend threads not initialized"
future = BAKEND_THREADS.get(task_id)