Ver Fonte

fix:权限缓存清理

duxin há 3 anos atrás
pai
commit
6cdcbdec43

+ 1 - 1
etc/config.yaml

@@ -20,7 +20,7 @@ nsq:
 #数据库配置
 databases:
   # redis配置
-  redis: main=127.0.0.1:6379,session=192.168.3.206:1712,other=192.168.3.206:1712
+  redis: main=127.0.0.1:6379,session=192.168.3.206:1712,newother=192.168.3.206:1712
   # nsq操作日志库
   mogLog:
     address: 192.168.3.206:27090

+ 4 - 3
handler/activity/jyActivity.go

@@ -33,9 +33,10 @@ type JyActivity struct {
 }
 
 const (
-	BidderPlanRedis = "main" //redis缓存库名
-	PowerCacheDb    = "other"
-	PowerCacheKey   = "bigmember_power_3_%s"
+	BidderPlanRedis           = "main" //redis缓存库名
+	PowerCacheDb              = "newother"
+	PowerCacheKey             = "bigmember_power_3_%s"
+	IsGetUserBaseInfoRedisKey = "baseinfo_%s"
 
 	BidderPlanScheduleCache  = "bidderPlan_v1_ScheduleValue_%s" //活动累计进度
 	BidderPlanFastClickCheck = "bidderPlanFastClickValue_%s"    //防止连点

+ 2 - 0
handler/activity/jyActivityOther.go

@@ -94,7 +94,9 @@ func (BP *JyActivity) GetDailyBoonSVip(userId string) (err error) {
 			_ = redis.SetExpire(BidderPlanRedis, hasKey, BP.cacheLong())
 			//领取7天超级订阅后清空权限缓存
 			cacheKey := fmt.Sprintf(PowerCacheKey, userId)
+			baseInfoCacheKey := fmt.Sprintf(IsGetUserBaseInfoRedisKey, userId)
 			redis.Del(PowerCacheDb, cacheKey)
+			redis.Del(PowerCacheDb, baseInfoCacheKey)
 		}
 		return nil
 	}()