Parcourir la source

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

duxin il y a 2 ans
Parent
commit
d314095a2d
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  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())
 			}