加速word count

This commit is contained in:
源文雨 2022-04-28 23:29:48 +08:00
parent 136e6bddf4
commit 592c306aa0

View File

@ -96,11 +96,11 @@ func init() {
return
}
messageMap := make(map[string]int, 256)
msghists := make(chan *gjson.Result, 256)
go func() {
h := ctx.GetLatestGroupMessageHistory(gid)
messageSeq := h.Get("messages.0.message_seq").Int()
msghists := make(chan *gjson.Result, 64)
msghists <- &h
go func() {
for i := 1; i < int(p/20) && messageSeq != 0; i++ {
h := ctx.GetGroupMessageHistory(gid, messageSeq)
msghists <- &h