Skip to content

Commit

Permalink
Refresh the conversation from the db in the websocket flow
Browse files Browse the repository at this point in the history
  • Loading branch information
sabaimran committed May 31, 2024
1 parent fd07abb commit 2667ef4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/khoj/routers/api_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ async def send_rate_limit_message(message: str):
if conversation:
await sync_to_async(conversation.refresh_from_db)(fields=["conversation_log"])
q = await websocket.receive_text()

# Refresh these because the connection to the database might have been closed
await conversation.arefresh_from_db()

except WebSocketDisconnect:
logger.debug(f"User {user} disconnected web socket")
break
Expand Down

0 comments on commit 2667ef4

Please sign in to comment.