feat(api): return live session from WS if not found in DB
This commit is contained in:
parent
8b80b6a0e6
commit
257e19dd30
2 changed files with 11 additions and 1 deletions
|
|
@ -77,6 +77,15 @@ def get_live_sessions_ws(project_id):
|
|||
return live_peers
|
||||
|
||||
|
||||
def get_live_session_by_id(project_id, session_id):
|
||||
all_live = get_live_sessions_ws(project_id)
|
||||
for l in all_live:
|
||||
if l.get("sessionID") == session_id:
|
||||
l["live"] = True
|
||||
return l
|
||||
return None
|
||||
|
||||
|
||||
def is_live(project_id, session_id, project_key=None):
|
||||
if project_key is None:
|
||||
project_key = projects.get_project_key(project_id)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ def get_by_id2_pg(project_id, session_id, user_id, full_data=False, include_fav_
|
|||
project_key=data["projectKey"])
|
||||
|
||||
return data
|
||||
return None
|
||||
else:
|
||||
return assist.get_live_session_by_id(project_id=project_id, session_id=session_id)
|
||||
|
||||
|
||||
def __get_sql_operator(op: schemas.SearchEventOperator):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue