🐛 fix(manager.py): change try-except block to if-elif block to improve code readability and maintainability
This commit is contained in:
parent
aec14bd250
commit
c3197c30f5
1 changed files with 2 additions and 2 deletions
|
|
@ -202,9 +202,9 @@ class ChatService(Service):
|
|||
|
||||
while True:
|
||||
json_payload = await websocket.receive_json()
|
||||
try:
|
||||
if isinstance(json_payload, str):
|
||||
payload = orjson.loads(json_payload)
|
||||
except Exception as exc:
|
||||
elif isinstance(json_payload, dict):
|
||||
payload = json_payload
|
||||
if "clear_history" in payload and payload["clear_history"]:
|
||||
self.chat_history.history[client_id] = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue