organization

This commit is contained in:
wangchuxiao
2022-05-17 20:42:43 +08:00
parent e2f8156a4d
commit 2454c50380
2 changed files with 13 additions and 5 deletions
+7
View File
@@ -20,6 +20,7 @@ import (
"strings"
"sync"
"time"
"unsafe"
)
type officeServer struct {
@@ -213,6 +214,12 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR
userIDList = append(userIDList[:i], userIDList[i+1:]...)
}
}
if unsafe.Sizeof(userIDList) > 1024*1024 {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "size", unsafe.Sizeof(userIDList))
resp.CommonResp.ErrMsg = constant.ErrSendLimit.ErrMsg
resp.CommonResp.ErrCode = constant.ErrSendLimit.ErrCode
return
}
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "total userIDList result: ", userIDList)
user, err := imdb.GetUserByUserID(req.SendID)
if err != nil {