File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
services/web/server/src/simcore_service_webserver/trash Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,14 @@ async def empty_trash(request: web.Request):
5050 user_id = get_user_id (request )
5151 product_name = products_web .get_product_name (request )
5252
53- is_fired = asyncio .Event ()
53+ explicitly_trashed_project_deleted = asyncio .Event ()
5454
5555 fire_and_forget_task (
5656 _service .safe_empty_trash (
5757 request .app ,
5858 product_name = product_name ,
5959 user_id = user_id ,
60- notify_explicit_projects_deleted = is_fired ,
60+ on_explicitly_trashed_projects_deleted = explicitly_trashed_project_deleted ,
6161 ),
6262 task_suffix_name = "rest.empty_trash" ,
6363 fire_and_forget_tasks_collection = request .app [APP_FIRE_AND_FORGET_TASKS_KEY ],
@@ -67,6 +67,6 @@ async def empty_trash(request: web.Request):
6767 # otherwise, when the front-end requests the trash item list,
6868 # it may still display items, misleading the user into
6969 # thinking the `empty trash` operation failed.
70- await is_fired .wait ()
70+ await explicitly_trashed_project_deleted .wait ()
7171
7272 return web .json_response (status = status .HTTP_204_NO_CONTENT )
Original file line number Diff line number Diff line change @@ -105,14 +105,13 @@ async def safe_empty_trash(
105105 * ,
106106 product_name : ProductName ,
107107 user_id : UserID ,
108- notify_explicit_projects_deleted : asyncio .Event | None = None
108+ on_explicitly_trashed_projects_deleted : asyncio .Event | None = None
109109):
110110 await _empty_explicitly_trashed_projects (app , product_name , user_id )
111+ if on_explicitly_trashed_projects_deleted :
112+ on_explicitly_trashed_projects_deleted .set ()
111113
112- # Notify the caller if an event is provided
113- if notify_explicit_projects_deleted :
114- notify_explicit_projects_deleted .set ()
115-
114+ # This can be heavy!
116115 await _empty_explicitly_trashed_folders_and_content (app , product_name , user_id )
117116
118117
You can’t perform that action at this time.
0 commit comments