wcj 5 年之前
父節點
當前提交
304658dead
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      src/jfw/modules/pushsubscribe/src/push/util/util.go

+ 11 - 2
src/jfw/modules/pushsubscribe/src/push/util/util.go

@@ -264,7 +264,7 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 		logger.Error(userId, "批量保存有问题", length, saveCount)
 	}
 	//更新redis
-	subPush, err := jy.SubscribePush.Get(userId)
+	subPush, err := jy.SubscribePush.GetTodayCache(userId)
 	if err == nil && subPush != nil {
 		if nowymd := util.NowFormat(util.Date_Short_Layout); subPush.Date != nowymd {
 			subPush = &jy.SubPush{
@@ -275,7 +275,16 @@ func SaveToPushsubscribe(isVipUser, isProjectInfo bool, userId string, matchInfo
 			subPush_datas = append(subPush_datas, subPush.Datas...)
 			subPush.Datas = subPush_datas
 		}
-		jy.SubscribePush.Put(userId, subPush)
+		jy.SubscribePush.PutTodayCache(userId, subPush)
+	}
+	//全部列表缓存
+	allCache, err := jy.SubscribePush.GetAllCache(userId)
+	if err != nil && allCache != nil {
+		subPush_datas = append(subPush_datas, allCache...)
+		if len(subPush_datas) > jy.AllSubPushCacheSize {
+			subPush_datas = subPush_datas[:jy.AllSubPushCacheSize]
+		}
+		jy.SubscribePush.PutAllCache(userId, subPush_datas)
 	}
 	//最近7天50条redis缓存处理
 	sevenDayCache, err := jy.SubscribePush.GetSevenDayCache(userId)