|
@@ -77,7 +77,7 @@ type wafTask struct {
|
|
|
}
|
|
|
|
|
|
const (
|
|
|
- OneDaysInSeconds = 1 * 24 * 60 * 60
|
|
|
+ SynchronousInSeconds = 7 * 24 * 60 * 60
|
|
|
SevenDaysInSeconds = 7 * 24 * 60 * 60
|
|
|
)
|
|
|
|
|
@@ -259,7 +259,7 @@ func (t *wafTask) findStaleWAFPlans(ctx context.Context) ([]model.GlobalLimit, e
|
|
|
// SynchronizationTime 同步即将到期(1天内)的套餐时间
|
|
|
func (t *wafTask) SynchronizationTime(ctx context.Context) error {
|
|
|
taskName := "同步到期时间"
|
|
|
- wafLimits, err := t.globalLimitRep.GetGlobalLimitAlmostExpired(ctx, OneDaysInSeconds)
|
|
|
+ wafLimits, err := t.globalLimitRep.GetGlobalLimitAlmostExpired(ctx, SynchronousInSeconds)
|
|
|
if err != nil {
|
|
|
return t.wrapTaskError(taskName, "查找失败", err)
|
|
|
}
|
|
@@ -273,7 +273,7 @@ func (t *wafTask) SynchronizationTime(ctx context.Context) error {
|
|
|
}
|
|
|
|
|
|
if len(renewalRequests) > 0 {
|
|
|
- t.logger.Info("发现记录需要同步到期时间", zap.String("task", taskName), zap.Int("数量", len(renewalRequests)))
|
|
|
+ t.logger.Info("发现记录需要同步到期时间", zap.String("task", taskName), zap.Int("数量", len(renewalRequests)), zap.Any("套餐内容", renewalRequests))
|
|
|
return t.wrapTaskError(taskName, "执行同步", t.executeRenewalActions(ctx, renewalRequests))
|
|
|
}
|
|
|
return nil
|
|
@@ -326,7 +326,7 @@ func (t *wafTask) StopPlan(ctx context.Context) error {
|
|
|
}
|
|
|
|
|
|
// 3. 执行停止操作
|
|
|
- t.logger.Info("开始关闭到期的WAF服务", zap.String("task", taskName), zap.Int("数量", len(plansToClose)))
|
|
|
+ t.logger.Info("开始关闭到期的WAF服务", zap.String("task", taskName), zap.Int("数量", len(plansToClose)), zap.Any("套餐内容", renewalRequests))
|
|
|
var hostIds []int
|
|
|
for _, limit := range plansToClose {
|
|
|
hostIds = append(hostIds, limit.HostId)
|
|
@@ -377,7 +377,7 @@ func (t *wafTask) _recoverPlans(ctx context.Context, limitsToCheck []model.Globa
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
- t.logger.Info("开始恢复已续费的WAF服务", zap.String("task", taskName), zap.Int("数量", len(finalRecoveryRequests)))
|
|
|
+ t.logger.Info("开始恢复已续费的WAF服务", zap.String("task", taskName), zap.Int("数量", len(finalRecoveryRequests)), zap.Any("套餐内容", finalRecoveryRequests))
|
|
|
|
|
|
var hostIdsToRecover []int
|
|
|
for _, req := range finalRecoveryRequests {
|
|
@@ -482,7 +482,7 @@ func (t *wafTask) CleanUpStaleRecords(ctx context.Context) error {
|
|
|
}
|
|
|
|
|
|
// 5. 并发执行清理操作
|
|
|
- t.logger.Info("开始清理长期未续费的WAF记录", zap.String("task", taskName), zap.Int("数量", len(plansToClean)))
|
|
|
+ t.logger.Info("开始清理长期未续费的WAF记录", zap.String("task", taskName), zap.Int("数量", len(plansToClean)), zap.Any("套餐内容", plansToClean))
|
|
|
|
|
|
var wg sync.WaitGroup
|
|
|
errChan := make(chan error, len(plansToClean))
|