From be6d4dbb63b8cfbcbe70c02d7968b0836b78b713 Mon Sep 17 00:00:00 2001 From: jjxu <428192774@qq.com> Date: Wed, 18 Jun 2025 15:27:26 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=BC=93=E5=AD=98key?= =?UTF-8?q?=E7=9A=84=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/asChat/chatCache/cache.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/service/asChat/chatCache/cache.go b/pkg/service/asChat/chatCache/cache.go index 70c54d5..fddd470 100644 --- a/pkg/service/asChat/chatCache/cache.go +++ b/pkg/service/asChat/chatCache/cache.go @@ -194,7 +194,8 @@ func (cr ChatCache) RecountNewMessageTotal(ownerId int64) { if len(messages) > 0 { _ = json.Unmarshal(messages, &data) } - var sessionId = strings.Split(key, ":")[2] + lastIndex := strings.Count(key, ":") + var sessionId = strings.Split(key, ":")[lastIndex] countMap[sessionId] = 0 for _, v := range data { if v.WaiterRead == 2 { //统计未读消息数量