mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Handle null ref, when refresh conversation from db in websocket chat
This commit is contained in:
parent
37879a7850
commit
9e068fad4f
1 changed files with 2 additions and 1 deletions
|
@ -338,7 +338,8 @@ async def websocket_endpoint(
|
|||
await websocket.accept()
|
||||
while connection_alive:
|
||||
try:
|
||||
await sync_to_async(conversation.refresh_from_db)(fields=["conversation_log"])
|
||||
if conversation:
|
||||
await sync_to_async(conversation.refresh_from_db)(fields=["conversation_log"])
|
||||
q = await websocket.receive_text()
|
||||
except WebSocketDisconnect:
|
||||
logger.debug(f"User {user} disconnected web socket")
|
||||
|
|
Loading…
Reference in a new issue