|
@@ -85,7 +85,6 @@ const (
|
|
|
|
|
|
type RenewalRequest struct {
|
|
|
HostId int
|
|
|
- PlanId int
|
|
|
ExpiredAt int64
|
|
|
}
|
|
|
|
|
@@ -192,12 +191,12 @@ func (t *wafTask) findPlansNeedingSync(ctx context.Context, wafLimits []model.Gl
|
|
|
return nil, nil
|
|
|
}
|
|
|
wafExpiredMap := make(map[int]int64, len(wafLimits))
|
|
|
- wafPlanMap := make(map[int]int, len(wafLimits))
|
|
|
+
|
|
|
var hostIds []int
|
|
|
for _, limit := range wafLimits {
|
|
|
hostIds = append(hostIds, limit.HostId)
|
|
|
wafExpiredMap[limit.HostId] = limit.ExpiredAt
|
|
|
- //wafPlanMap[limit.HostId] = limit.RuleId
|
|
|
+
|
|
|
}
|
|
|
|
|
|
hostExpirations, err := t.hostRep.GetExpireTimeByHostId(ctx, hostIds)
|
|
@@ -213,12 +212,8 @@ func (t *wafTask) findPlansNeedingSync(ctx context.Context, wafLimits []model.Gl
|
|
|
for hostId, wafExpiredTime := range wafExpiredMap {
|
|
|
hostTime, ok := hostExpiredMap[hostId]
|
|
|
if !ok || hostTime != wafExpiredTime {
|
|
|
- planId, planOk := wafPlanMap[hostId]
|
|
|
- if !planOk {
|
|
|
- t.logger.Warn("数据不一致:在waf_limits中找不到hostId对应的套餐ID", zap.Int("hostId", hostId))
|
|
|
- continue
|
|
|
- }
|
|
|
- renewalRequests = append(renewalRequests, RenewalRequest{HostId: hostId, ExpiredAt: hostTime, PlanId: planId})
|
|
|
+
|
|
|
+ renewalRequests = append(renewalRequests, RenewalRequest{HostId: hostId, ExpiredAt: hostTime})
|
|
|
}
|
|
|
}
|
|
|
return renewalRequests, nil
|