api/tasks: rename 'cancel_task' into 'delete_task'
This commit is contained in:
@@ -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) => (
|
||||
|
||||
@@ -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) => (
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user