mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Refresh the conversation from the db in the websocket flow
This commit is contained in:
@@ -487,6 +487,10 @@ async def websocket_endpoint(
|
|||||||
if conversation:
|
if conversation:
|
||||||
await sync_to_async(conversation.refresh_from_db)(fields=["conversation_log"])
|
await sync_to_async(conversation.refresh_from_db)(fields=["conversation_log"])
|
||||||
q = await websocket.receive_text()
|
q = await websocket.receive_text()
|
||||||
|
|
||||||
|
# Refresh these because the connection to the database might have been closed
|
||||||
|
await conversation.arefresh_from_db()
|
||||||
|
|
||||||
except WebSocketDisconnect:
|
except WebSocketDisconnect:
|
||||||
logger.debug(f"User {user} disconnected web socket")
|
logger.debug(f"User {user} disconnected web socket")
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user