mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-04 03:03:37 +08:00
feat: warn logs
This commit is contained in:
parent
7a35975ba1
commit
b28d0fd8fb
@ -228,7 +228,8 @@ func (c *ConsumerHandler) GetConnsAndOnlinePush(ctx context.Context, msg *sdkws.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *ConsumerHandler) Push2Group(ctx context.Context, groupID string, msg *sdkws.MsgData) (err error) {
|
func (c *ConsumerHandler) Push2Group(ctx context.Context, groupID string, msg *sdkws.MsgData) (err error) {
|
||||||
log.ZDebug(ctx, "Get group msg from msg_transfer and push msg", "msg", msg.String(), "groupID", groupID)
|
//log.ZDebug(ctx, "Get group msg from msg_transfer and push msg", "msg", msg.String(), "groupID", groupID)
|
||||||
|
log.ZWarn(ctx, "Get group msg from msg_transfer and push msg", nil, "msg", msg.String(), "groupID", groupID)
|
||||||
defer func(duration time.Time) {
|
defer func(duration time.Time) {
|
||||||
t := time.Since(duration)
|
t := time.Since(duration)
|
||||||
log.ZWarn(ctx, "Get group msg from msg_transfer and push msg end", nil, "msg", msg.String(), "groupID", groupID, "time cost", t)
|
log.ZWarn(ctx, "Get group msg from msg_transfer and push msg end", nil, "msg", msg.String(), "groupID", groupID, "time cost", t)
|
||||||
@ -238,32 +239,37 @@ func (c *ConsumerHandler) Push2Group(ctx context.Context, groupID string, msg *s
|
|||||||
&pushToUserIDs); err != nil {
|
&pushToUserIDs); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.ZDebug(ctx, "webhookBeforeGroupOnlinePush end")
|
//log.ZDebug(ctx, "webhookBeforeGroupOnlinePush end")
|
||||||
|
log.ZWarn(ctx, "webhookBeforeGroupOnlinePush end", nil)
|
||||||
|
|
||||||
err = c.groupMessagesHandler(ctx, groupID, &pushToUserIDs, msg)
|
err = c.groupMessagesHandler(ctx, groupID, &pushToUserIDs, msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.ZDebug(ctx, "groupMessagesHandler end")
|
//log.ZDebug(ctx, "groupMessagesHandler end")
|
||||||
|
log.ZWarn(ctx, "groupMessagesHandler end", nil)
|
||||||
|
|
||||||
wsResults, err := c.GetConnsAndOnlinePush(ctx, msg, pushToUserIDs)
|
wsResults, err := c.GetConnsAndOnlinePush(ctx, msg, pushToUserIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.ZDebug(ctx, "group push result", "result", wsResults, "msg", msg)
|
//log.ZDebug(ctx, "group push result", "result", wsResults, "msg", msg)
|
||||||
|
log.ZWarn(ctx, "group push result", nil, "result", wsResults, "msg", msg)
|
||||||
|
|
||||||
if !c.shouldPushOffline(ctx, msg) {
|
if !c.shouldPushOffline(ctx, msg) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
needOfflinePushUserIDs := c.onlinePusher.GetOnlinePushFailedUserIDs(ctx, msg, wsResults, &pushToUserIDs)
|
needOfflinePushUserIDs := c.onlinePusher.GetOnlinePushFailedUserIDs(ctx, msg, wsResults, &pushToUserIDs)
|
||||||
log.ZDebug(ctx, "GetOnlinePushFailedUserIDs end")
|
//log.ZDebug(ctx, "GetOnlinePushFailedUserIDs end")
|
||||||
|
log.ZWarn(ctx, "GetOnlinePushFailedUserIDs end", nil)
|
||||||
//filter some user, like don not disturb or don't need offline push etc.
|
//filter some user, like don not disturb or don't need offline push etc.
|
||||||
needOfflinePushUserIDs, err = c.filterGroupMessageOfflinePush(ctx, groupID, msg, needOfflinePushUserIDs)
|
needOfflinePushUserIDs, err = c.filterGroupMessageOfflinePush(ctx, groupID, msg, needOfflinePushUserIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.ZDebug(ctx, "filterGroupMessageOfflinePush end")
|
//log.ZDebug(ctx, "filterGroupMessageOfflinePush end")
|
||||||
|
log.ZWarn(ctx, "filterGroupMessageOfflinePush end", nil)
|
||||||
|
|
||||||
// Use offline push messaging
|
// Use offline push messaging
|
||||||
if len(needOfflinePushUserIDs) > 0 {
|
if len(needOfflinePushUserIDs) > 0 {
|
||||||
@ -272,7 +278,8 @@ func (c *ConsumerHandler) Push2Group(ctx context.Context, groupID string, msg *s
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.ZDebug(ctx, "webhookBeforeOfflinePush end")
|
//log.ZDebug(ctx, "webhookBeforeOfflinePush end")
|
||||||
|
log.ZWarn(ctx, "webhookBeforeOfflinePush end", nil)
|
||||||
if len(offlinePushUserIDs) > 0 {
|
if len(offlinePushUserIDs) > 0 {
|
||||||
needOfflinePushUserIDs = offlinePushUserIDs
|
needOfflinePushUserIDs = offlinePushUserIDs
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user