浏览代码

feat:userid为空redis缓存时间修改

duxin 2 年之前
父节点
当前提交
d314095a2d
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      jyBXBase/rpc/internal/logic/newestbiddinglogic.go

+ 5 - 1
jyBXBase/rpc/internal/logic/newestbiddinglogic.go

@@ -196,7 +196,11 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 			r.ErrCode = -1
 			r.ErrMsg = fmt.Sprintf("保存缓存 序列化异常,err:%s", err.Error())
 		} else {
-			if err = redis.PutBytes("other", "p1_indexMessage_new_"+rks, &b, 2*60*60); err != nil {
+			timeOut := 2 * 60 * 60
+			if in.UserId == "" {
+				timeOut = 24 * 60 * 60
+			}
+			if err = redis.PutBytes("other", "p1_indexMessage_new_"+rks, &b, timeOut); err != nil {
 				r.ErrCode = -1
 				r.ErrMsg = fmt.Sprintf("保存缓存 redis 异常,err:%s", err.Error())
 			}