File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
services/web/server/src/simcore_service_webserver/trash Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,16 @@ async def empty_trash(request: web.Request):
5050 user_id = get_user_id (request )
5151 product_name = get_product_name (request )
5252
53- fire_and_forget_task (
54- _service .safe_empty_trash (
53+ is_running = asyncio .Event ()
54+
55+ async def _run ():
56+ is_running .set ()
57+ await _service .safe_empty_trash (
5558 request .app , product_name = product_name , user_id = user_id
56- ),
59+ )
60+
61+ fire_and_forget_task (
62+ _run (),
5763 task_suffix_name = "rest.empty_trash" ,
5864 fire_and_forget_tasks_collection = request .app [APP_FIRE_AND_FORGET_TASKS_KEY ],
5965 )
@@ -62,6 +68,6 @@ async def empty_trash(request: web.Request):
6268 # when the front-end requests the trash item list,
6369 # it may still display items, misleading the user into
6470 # thinking the `empty trash` operation failed.
65- await asyncio . sleep ( 1 )
71+ await is_running . wait ( )
6672
6773 return web .json_response (status = status .HTTP_204_NO_CONTENT )
You can’t perform that action at this time.
0 commit comments