Selaa lähdekoodia

fix:权限缓存清理

duxin 3 vuotta sitten
vanhempi
commit
74f6d69544
3 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 1 1
      etc/config.yaml
  2. 2 0
      handler/activity/jyActivity.go
  3. 3 0
      handler/activity/jyActivityOther.go

+ 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
+  redis: main=127.0.0.1:6379,session=192.168.3.206:1712,other=192.168.3.206:1712
   # nsq操作日志库
   mogLog:
     address: 192.168.3.206:27090

+ 2 - 0
handler/activity/jyActivity.go

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

+ 3 - 0
handler/activity/jyActivityOther.go

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