|
@@ -157,7 +157,7 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
|
|
|
if in.UserId != "" {
|
|
|
key := fmt.Sprintf(TaskActivityCacheKey, in.PositionId, TaskActiveId, TaskIdSearch)
|
|
|
if exist, _ := redis.Exists("other", key); !exist {
|
|
|
- redis.Put("other", key, 1, GetLastTime())
|
|
|
+ redis.Put("other", key, 1, GetTimeout(TaskActivityCacheTimeout))
|
|
|
nsqNode := jy.Jyweb_node2
|
|
|
if in.Platform == "WX" {
|
|
|
nsqNode = jy.Jywx_node1
|
|
@@ -273,8 +273,7 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
|
|
|
ErrCode: 0,
|
|
|
}, nil
|
|
|
}
|
|
|
-func GetLastTime() int {
|
|
|
- n := TaskActivityCacheTimeout
|
|
|
+func GetTimeout(n int) int {
|
|
|
t := time.Now()
|
|
|
midnight := time.Date(t.Year(), t.Month(), t.Day()+1, 0, 0, 0, 0, t.Location())
|
|
|
if midnight.After(t) {
|