This commit is contained in:
Robin 2024-12-13 17:50:31 +08:00
parent 29a5827ee5
commit f211d50df6
4 changed files with 8 additions and 4 deletions

View File

@ -3393,7 +3393,7 @@ func (s *Service) ApiUpdateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
}
// 发送通知
DefaultNotifBuilderHandler.Handle(ctx)(consts.AudNotifTemp_ZoneMomentReedited)(req.ZoneMoment)
DefaultNotifBuilderHandler.Handle(ctx)(consts.AudNotifTemp_ZoneMomentReedited)(zonemoment)
return
}

View File

@ -132,6 +132,7 @@ func (s *NotifBcstCenter) pushNotifsToMids(ctx *gin.Context, nids []int64, objMi
}
logger.Info("trying to update recent_receive...")
logger.Info("mid_recent_receive_map: %v", midRecentReceiveMap)
// 尝试更新最近接收消息记录
for mid, recentReceiveMap := range midRecentReceiveMap {
logger.Info("recent_receive_map: %v", recentReceiveMap)
@ -389,6 +390,7 @@ func (s *NotifBcstCenter) tryToReplaceRecentReceive(recentReceiveMap map[int64]*
}
// 比较最近接收时间
recentReceive, ok := recentReceiveMap[notifReceive.NType]
logger.Info("now recent_receive: %v, obj: %v", recentReceive, notifReceive)
if ok {
if notifReceive.Ct > recentReceive.Rt {
recentReceiveMap[notifReceive.NType].Nid = notifReceive.Nid

View File

@ -575,7 +575,9 @@ func (handler *NotifBuilderHandler) handleAudZoneMomentRejected() {
func (handler *NotifBuilderHandler) handleAudZoneMomentReedited() {
handler.handlerMap[consts.AudNotifTemp_ZoneMomentReedited] = func(ctx *gin.Context, args ...any) {
zonemoment := args[0].(*dbstruct.ZoneMoment)
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_ZoneMomentReedited, zonemoment.GetMid())
cTypeDesc := consts.ZoneMomentCTypeDescMap[zonemoment.GetCType()]
mTypeDesc := consts.MTypeDescMap[zonemoment.GetMType()]
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_ZoneMomentReedited, zonemoment.GetMid(), cTypeDesc, mTypeDesc)
}
}

View File

@ -2364,7 +2364,7 @@ func (s *Service) utilBuildInwardHyperLink(ctx *gin.Context, frontendRouteId int
}
func (s *Service) utilIncrUrc(mid, nType, incr int64) error {
logger.Info("increasing urc_%v_%v by %v records", incr)
logger.Info("increasing urc_%v_%v by %v records", mid, nType, incr)
_, err := redis.GetRedisClient().IncrBy(util.GetNotifUrcIdForRedis(mid, nType), incr)
if err != nil {
logger.Error("Redis IncrBy fail, err: %v", err)
@ -2379,7 +2379,7 @@ func (s *Service) utilIncrUrc(mid, nType, incr int64) error {
}
func (s *Service) utilDecrUrc(mid, nType, incr int64) error {
logger.Info("decreasing urc_%v_%v by %v records", incr)
logger.Info("decreasing urc_%v_%v by %v records", mid, nType, incr)
_, err := redis.GetRedisClient().DecrBy(util.GetNotifUrcIdForRedis(mid, nType), incr)
if err != nil {
logger.Error("Redis DecrBy fail, err: %v", err)