QVAC Logo

cancel( )

Cancels an ongoing operation.

function cancel(params): Promise<void>;

Parameters

NameTypeRequired?Description
paramsobjectThe parameters for the cancellation

params

Cancel inference

FieldTypeRequired?Description
operation"inference"Operation type
modelIdstringModel identifier

Cancel download

FieldTypeRequired?DefaultDescription
operation"downloadAsset"-Operation type
downloadKeystring-Download key
clearCachebooleanfalseWhether to delete the partial file

Returns

Promise<void> — Resolves when the operation is cancelled.

Throws

When the response type is invalid or when the cancellation fails

Example

// Cancel inference
await cancel({ operation: "inference", modelId: "model-123" });
// Pause download (preserves partial file for automatic resume)
await cancel({ operation: "download", downloadKey: "download-key" });
// Cancel download completely (deletes partial file)
await cancel({ operation: "download", downloadKey: "download-key", clearCache: true });

On this page