Skip to content

Commit

Permalink
avoid creating existing session (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard authored Jan 5, 2024
1 parent abe4a31 commit af45fbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/chainlit/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ async def create_user_session(
anon_user_id: str,
user_id: Optional[str],
) -> Dict:
existing_session = await self.client.api.get_user_session(id=id)
if existing_session:
return existing_session
session = await self.client.api.create_user_session(
id=id,
started_at=started_at,
Expand Down

0 comments on commit af45fbf

Please sign in to comment.