Skip to content

Commit 23ae4ca

Browse files
committed
msg
1 parent e3fdf00 commit 23ae4ca

File tree

1 file changed

+7
-8
lines changed
  • services/web/server/src/simcore_service_webserver/trash

1 file changed

+7
-8
lines changed

services/web/server/src/simcore_service_webserver/trash/_rest.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import logging
23

34
from aiohttp import web
@@ -20,10 +21,6 @@
2021

2122
_logger = logging.getLogger(__name__)
2223

23-
#
24-
# EXCEPTIONS HANDLING
25-
#
26-
2724

2825
_TO_HTTP_ERROR_MAP: ExceptionToHttpErrorMap = {
2926
ProjectRunningConflictError: HttpErrorInfo(
@@ -42,10 +39,6 @@
4239
)
4340

4441

45-
#
46-
# ROUTES
47-
#
48-
4942
routes = 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)

0 commit comments

Comments
 (0)