File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -117,18 +117,16 @@ async def create_session(
117117 f"Loaded { len (list_sessions_response .sessions )} sessions from db { self .db_url } ."
118118 )
119119
120- if (
121- await self ._session_service .get_session (
122- app_name = app_name , user_id = user_id , session_id = session_id
120+ session = await self ._session_service .get_session (
121+ app_name = app_name , user_id = user_id , session_id = session_id
122+ )
123+
124+ if session :
125+ logger .info (
126+ f"Session { session_id } already exists with app_name={ app_name } user_id={ user_id } ."
123127 )
124- is None
125- ) :
128+ return session
129+ else :
126130 return await self ._session_service .create_session (
127131 app_name = app_name , user_id = user_id , session_id = session_id
128132 )
129- else :
130- logger .info (
131- f"Session { session_id } already exists with app_name={ app_name } user_id={ user_id } ."
132- )
133-
134- return None
You can’t perform that action at this time.
0 commit comments