mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-28 01:11:31 +08:00
⚡️ perf(ai-chat): 优化会话持久化序列化方式
- 序列化方式:AISaveSession 从 MarshalIndent 改为 Marshal - 存储优化:移除不必要的缩进格式化,减少磁盘占用 - 性能提升:紧凑 JSON 序列化速度更快,减少内存分配
This commit is contained in:
@@ -1122,7 +1122,7 @@ func (s *Service) AISaveSession(sessionID string, title string, updatedAt float6
|
||||
Messages: json.RawMessage(messagesJSON),
|
||||
}
|
||||
|
||||
data, err := json.MarshalIndent(sfd, "", " ")
|
||||
data, err := json.Marshal(sfd)
|
||||
if err != nil {
|
||||
return fmt.Errorf("序列化会话数据失败: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user