File tree 2 files changed +7
-8
lines changed
services/web/server/src/simcore_service_webserver/trash
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):
50
50
user_id = get_user_id (request )
51
51
product_name = products_web .get_product_name (request )
52
52
53
- is_fired = asyncio .Event ()
53
+ explicitly_trashed_project_deleted = asyncio .Event ()
54
54
55
55
fire_and_forget_task (
56
56
_service .safe_empty_trash (
57
57
request .app ,
58
58
product_name = product_name ,
59
59
user_id = user_id ,
60
- notify_explicit_projects_deleted = is_fired ,
60
+ on_explicitly_trashed_projects_deleted = explicitly_trashed_project_deleted ,
61
61
),
62
62
task_suffix_name = "rest.empty_trash" ,
63
63
fire_and_forget_tasks_collection = request .app [APP_FIRE_AND_FORGET_TASKS_KEY ],
@@ -67,6 +67,6 @@ async def empty_trash(request: web.Request):
67
67
# otherwise, when the front-end requests the trash item list,
68
68
# it may still display items, misleading the user into
69
69
# thinking the `empty trash` operation failed.
70
- await is_fired .wait ()
70
+ await explicitly_trashed_project_deleted .wait ()
71
71
72
72
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(
105
105
* ,
106
106
product_name : ProductName ,
107
107
user_id : UserID ,
108
- notify_explicit_projects_deleted : asyncio .Event | None = None
108
+ on_explicitly_trashed_projects_deleted : asyncio .Event | None = None
109
109
):
110
110
await _empty_explicitly_trashed_projects (app , product_name , user_id )
111
+ if on_explicitly_trashed_projects_deleted :
112
+ on_explicitly_trashed_projects_deleted .set ()
111
113
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!
116
115
await _empty_explicitly_trashed_folders_and_content (app , product_name , user_id )
117
116
118
117
You can’t perform that action at this time.
0 commit comments