File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
packages/service-library/src/servicelib
aiohttp/long_running_tasks Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -91,10 +91,7 @@ async def start_long_running_task(
9191 except asyncio .CancelledError :
9292 # cancel the task, the client has disconnected
9393 if task_id :
94- long_running_manager = get_long_running_manager (request_ .app )
95- await long_running_manager .tasks_manager .cancel_task (
96- task_id , with_task_context = None
97- )
94+ await lrt_api .cancel_task (long_running_manager .tasks_manager , None , task_id )
9895 raise
9996
10097
Original file line number Diff line number Diff line change @@ -105,3 +105,10 @@ async def remove_task(
105105) -> None :
106106 """removes / cancels a task"""
107107 await tasks_manager .remove_task (task_id , with_task_context = task_context )
108+
109+
110+ async def cancel_task (
111+ tasks_manager : TasksManager , task_context : TaskContext | None , task_id : TaskId
112+ ) -> None :
113+ """cancels a task"""
114+ await tasks_manager .cancel_task (task_id , with_task_context = task_context )
You can’t perform that action at this time.
0 commit comments