Skip to content

cancel

cancel

Cancel command for Marianne CLI.

Provides mzt cancel to immediately cancel a running job via asyncio task cancellation. Unlike pause, this interrupts mid-sheet and does not wait for a clean boundary. Use pause for graceful stops; use cancel when the job must stop now.

Classes

Functions

cancel

cancel(job_id=Argument(..., help='Score ID to cancel'), json_output=Option(False, '--json', '-j', help='Output result as JSON'))

Cancel a running Marianne score immediately.

Unlike pause, this does not wait for a sheet boundary. The score's asyncio task is cancelled, in-progress work is rolled back, and the score is marked as CANCELLED. Use pause for graceful stops.

Examples:

mzt cancel my-job mzt cancel my-job --json

Source code in src/marianne/cli/commands/cancel.py
def cancel(
    job_id: str = typer.Argument(..., help="Score ID to cancel"),
    json_output: bool = typer.Option(
        False,
        "--json",
        "-j",
        help="Output result as JSON",
    ),
) -> None:
    """Cancel a running Marianne score immediately.

    Unlike `pause`, this does not wait for a sheet boundary. The score's
    asyncio task is cancelled, in-progress work is rolled back, and the
    score is marked as CANCELLED. Use `pause` for graceful stops.

    Examples:
        mzt cancel my-job
        mzt cancel my-job --json
    """
    from ._shared import validate_job_id

    job_id = validate_job_id(job_id)
    asyncio.run(_cancel_job(job_id, json_output))