File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
services/web/server/src/simcore_service_webserver/trash Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 1+ import asyncio
12import logging
23
34from aiohttp import web
2021
2122_logger = logging .getLogger (__name__ )
2223
23- #
24- # EXCEPTIONS HANDLING
25- #
26-
2724
2825_TO_HTTP_ERROR_MAP : ExceptionToHttpErrorMap = {
2926 ProjectRunningConflictError : HttpErrorInfo (
4239)
4340
4441
45- #
46- # ROUTES
47- #
48-
4942routes = web .RouteTableDef ()
5043
5144
@@ -65,4 +58,10 @@ async def empty_trash(request: web.Request):
6558 fire_and_forget_tasks_collection = request .app [APP_FIRE_AND_FORGET_TASKS_KEY ],
6659 )
6760
61+ # NOTE: Ensures `fire_and_forget_task` is triggered; otherwise,
62+ # when the front-end requests the trash item list,
63+ # it may still display items, misleading the user into
64+ # thinking the `empty trash` operation failed.
65+ await asyncio .sleep (1 )
66+
6867 return web .json_response (status = status .HTTP_204_NO_CONTENT )
You can’t perform that action at this time.
0 commit comments