瀏覽代碼

fix(waf): 修正 WAF 过期时间判断逻辑

- 修改了 WAF 过期时间的判断条件,从小于等于改为大于等于
- 更新了 Redis 数据库配置,将 db 从0 改为 10
fusu 7 小時之前
父節點
當前提交
55406b82ae
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      config/local.yml
  2. 1 1
      internal/service/admin/wafmanage.go

+ 1 - 1
config/local.yml

@@ -35,7 +35,7 @@ data:
   redis:
     addr: 110.42.96.15:26739
     password: "rzcmhtLCKpsYfFcZ"
-    db: 0
+    db: 10
     read_timeout: 0.2s
     write_timeout: 0.2s
 

+ 1 - 1
internal/service/admin/wafmanage.go

@@ -72,7 +72,7 @@ func (s *wafManageService) SyncExecuteRenewalActions(ctx context.Context,req adm
 	var notExpiredHostIds []int
 
 	for _, limit := range *wafExpireTime {
-		if limit.ExpiredAt <= time.Now().Unix() - 1 * 60 * 60 {
+		if limit.ExpiredAt >= time.Now().Unix() - 1 * 60 * 60 {
 			notExpiredHostIds = append(notExpiredHostIds, limit.HostId)
 		}
 	}