dashboard
repositories
activity
search
login
APPS
/
ops-dashboard
summary
reflog
commits
tree
compare
forks
blame
|
history
|
raw
|
HEAD
feat: backup download endpoint + skip-backup sync option
Matthias Nott
2026-02-26
5d0247159b125bf035285d56c2b9bb58d6bb3029
[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}'")