This commit is contained in:
Phil Zhitnikov 2024-08-05 00:11:28 +04:00
parent 5620a97512
commit eafc74894d

View File

@ -18,6 +18,7 @@ async def cancel_task(app: FastAPI, identifier):
tasks: List[Task] = app.state.tasks.get(identifier)
if not tasks:
logger.info(f"Task {identifier} not found, can't cancel")
return
for task in tasks:
try:
task.cancel()