File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
services/web/server/src/simcore_service_webserver Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 1717async def remove_disconnected_user_resources (
1818 registry : RedisResourceRegistry , app : web .Application
1919) -> None :
20-
2120 # NOTE:
2221 # Each user session is represented in the redis registry with two keys:
2322 # - "alive" is a string that keeps a TTL of the user session
@@ -31,7 +30,7 @@ async def remove_disconnected_user_resources(
3130
3231 # clean up all resources of expired keys
3332 for dead_session in dead_user_sessions :
34- user_id = int ( dead_session ["user_id" ])
33+ user_id = dead_session ["user_id" ]
3534
3635 # (0) If key has no resources => remove from registry and continue
3736 resources = await registry .get_resources (dead_session )
@@ -53,10 +52,13 @@ async def remove_disconnected_user_resources(
5352 # inform that the project can be closed on the backend side
5453 #
5554 project_id = TypeAdapter (ProjectID ).validate_python (resource_value )
56- with log_catch (_logger , reraise = False ), log_context (
57- _logger ,
58- logging .INFO ,
59- "Closing project {project_id} for user {user_id=}" ,
55+ with (
56+ log_catch (_logger , reraise = False ),
57+ log_context (
58+ _logger ,
59+ logging .INFO ,
60+ "Closing project {project_id} for user {user_id=}" ,
61+ ),
6062 ):
6163 await _projects_service .close_project_for_user (
6264 user_id = user_id ,
Original file line number Diff line number Diff line change 3939_RESOURCE_SUFFIX = "resources" # points to a hash (like a dict) type
4040
4141
42- class _UserRequired (TypedDict , total = True ):
43- user_id : str | UserID
44-
45-
46- class UserSessionDict (_UserRequired ):
42+ class UserSessionDict (TypedDict ):
4743 """Parts of the key used in redis for a user-session"""
4844
45+ user_id : UserID
4946 client_session_id : str
5047
5148
You can’t perform that action at this time.
0 commit comments