Skip to content

_runner

_check_shutdown_is_supported()

Raises:

Type Description
HTTPException(status_code=HTTP_422_UNPROCESSABLE_ENTITY)

If FRACTAL_RUNNER_BACKEND is the thread-based 'local' backend.

Source code in fractal_server/app/routes/aux/_runner.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def _check_shutdown_is_supported():
    """
    Raises:
        HTTPException(status_code=HTTP_422_UNPROCESSABLE_ENTITY):
            If FRACTAL_RUNNER_BACKEND is the thread-based 'local' backend.
    """
    settings = Inject(get_settings)
    backend = settings.FRACTAL_RUNNER_BACKEND

    if not _backend_supports_shutdown(backend):
        raise HTTPException(
            status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
            detail=(
                "Stopping a job execution is not implemented for "
                f"FRACTAL_RUNNER_BACKEND={backend}."
            ),
        )