소스 검색

Fix push_service: fix records

StrayWarrior 5 달 전
부모
커밋
b4289b435f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      pqai_agent/push_service.py

+ 1 - 1
pqai_agent/push_service.py

@@ -168,7 +168,7 @@ class PushTaskWorkerPool:
                         messages_to_send.append(item)
             current_ts = int(time.time())
             with self.agent_service.AgentDBSession() as session:
-                msg_list = []
+                msg_list = [{"type": msg["type"].value, "content": msg["content"]} for msg in messages_to_send]
                 record = AgentPushRecord(staff_id=staff_id, user_id=user_id,
                                          content=json.dumps(msg_list, ensure_ascii=False),
                                          timestamp=current_ts)