hotfix #97

Merged
李寻欢 merged 3 commits from hotfix into main 2024-08-19 11:49:44 +08:00
Showing only changes of commit f3e2f6e429 - Show all commits

View File

@ -19,8 +19,12 @@ import (
"time" "time"
) )
// 已经通知过的群组或者好友map
var notifyMap = make(map[string]bool) var notifyMap = make(map[string]bool)
// 拉取最近消息条数
const fetchMessageCount = 20
// AI // AI
// @description: AI消息 // @description: AI消息
// @param m // @param m
@ -198,7 +202,7 @@ func getGroupUserMessages(msgId int64, groupId, groupUserId string) (records []e
Where("create_at >= DATE_SUB(NOW(),INTERVAL 30 MINUTE)"). Where("create_at >= DATE_SUB(NOW(),INTERVAL 30 MINUTE)").
Where(subQuery). Where(subQuery).
Order("create_at desc"). Order("create_at desc").
Limit(4).Find(&records) Limit(fetchMessageCount).Find(&records)
return return
} }
@ -214,6 +218,6 @@ func getUserPrivateMessages(userId string) (records []entity.Message) {
Where("create_at >= DATE_SUB(NOW(),INTERVAL 30 MINUTE)"). Where("create_at >= DATE_SUB(NOW(),INTERVAL 30 MINUTE)").
Where(subQuery). Where(subQuery).
Order("create_at desc"). Order("create_at desc").
Limit(4).Find(&records) Limit(fetchMessageCount).Find(&records)
return return
} }