organization

This commit is contained in:
wangchuxiao 2022-05-18 12:51:33 +08:00
parent 317fed304c
commit 0e03fb6393

View File

@ -240,6 +240,7 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR
var tagSendLogs db.TagSendLog
wg.Add(len(userIDList))
var lock sync.Mutex
for _, userID := range userIDList {
go func(userID string) {
defer wg.Done()
@ -248,10 +249,12 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error())
return
}
lock.Lock()
tagSendLogs.UserList = append(tagSendLogs.UserList, db.TagUser{
UserID: userID,
UserName: userName,
})
lock.Unlock()
}(userID)
}
wg.Wait()