|
@@ -35,14 +35,26 @@ func AddCygxPageHistoryRecord(user *models.WxUserItem, Ctx *context.Context) {
|
|
|
item.PageRouter = pr.PageRouter
|
|
|
}
|
|
|
if strings.Contains(item.Router, "/api/article/detail") {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
cacheKey := fmt.Sprint("uid:", user.UserId, "_Parameter:", item.Parameter)
|
|
|
isExist := utils.Rc.IsExist(cacheKey)
|
|
|
- if !isExist {
|
|
|
- setNX := utils.Rc.SetNX(cacheKey, user.Mobile, time.Second*10)
|
|
|
+ if isExist {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ setNX := utils.Rc.SetNX(cacheKey, user.Mobile, time.Second*10)
|
|
|
+ if !setNX {
|
|
|
if !setNX {
|
|
|
go utils.SendAlarmMsg("记录用户阅读文章,设置Redis Key 过期时间失败:key"+cacheKey, 3)
|
|
|
}
|
|
|
- return
|
|
|
}
|
|
|
}
|
|
|
|