dashboard
repositories
activity
search
login
APPS
/
ops-dashboard
summary
reflog
commits
tree
compare
forks
blame
|
history
|
raw
|
HEAD
fix: enable bidirectional sync pairs (int<->prod, dev<->int)
Matthias Nott
2026-02-25
31ac43fd7a4f16295562aab8826bcb6929fbcc17
[APPS/ops-dashboard.git]
/
app
/
routers
/
cancel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from fastapi import APIRouter, Depends, HTTPException
from app.auth import verify_token
from app.ops_runner import cancel_op
router = APIRouter()
@router.delete("/{op_id}", summary="Cancel a running operation")
async def cancel_operation(
op_id: str,
_: str = Depends(verify_token),
) -> dict:
"""Terminate a running operation by its op_id."""
if cancel_op(op_id):
return {"cancelled": True, "op_id": op_id}
raise HTTPException(status_code=404, detail=f"No active operation with id '{op_id}'")