|
@@ -9,11 +9,11 @@ import (
|
|
|
|
|
|
//AddSearchKeyWord 记录用户搜索关键词
|
|
|
func AddSearchKeyWord(user *models.WxUserItem, keyWord string, source int) (err error) {
|
|
|
- cacheKey := fmt.Sprint("Search_uid:", user.UserId, "_KeyWord:", keyWord, "_Source:", source)
|
|
|
- isExist := utils.Rc.IsExist(cacheKey)
|
|
|
- if isExist {
|
|
|
- return err
|
|
|
- }
|
|
|
+ //cacheKey := fmt.Sprint("Search_uid:", user.UserId, "_KeyWord:", keyWord, "_Source:", source)
|
|
|
+ //isExist := utils.Rc.IsExist(cacheKey)
|
|
|
+ //if isExist {
|
|
|
+ // return err
|
|
|
+ //}
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
go utils.SendAlarmMsg(" 记录用户搜索关键词失败"+err.Error(), 2)
|
|
@@ -30,12 +30,12 @@ func AddSearchKeyWord(user *models.WxUserItem, keyWord string, source int) (err
|
|
|
keyWordItem.CompanyName = user.CompanyName
|
|
|
keyWordItem.RealName = user.RealName
|
|
|
_, err = models.AddSearchKeyWord(keyWordItem)
|
|
|
- go AddUserSearchLog(user, keyWord, source)
|
|
|
- //一分钟之内的相同搜索词不重复记录
|
|
|
- setNX := utils.Rc.SetNX(cacheKey, keyWord, time.Minute*1)
|
|
|
- if !setNX {
|
|
|
- go utils.SendAlarmMsg("记录用户搜索关键词失败,设置Redis Key 过期时间失败:key"+cacheKey, 3)
|
|
|
- }
|
|
|
+ //go AddUserSearchLog(user, keyWord, source)
|
|
|
+ ////一分钟之内的相同搜索词不重复记录
|
|
|
+ //setNX := utils.Rc.SetNX(cacheKey, keyWord, time.Minute*1)
|
|
|
+ //if !setNX {
|
|
|
+ // go utils.SendAlarmMsg("记录用户搜索关键词失败,设置Redis Key 过期时间失败:key"+cacheKey, 3)
|
|
|
+ //}
|
|
|
return
|
|
|
}
|
|
|
|