Browse Source

perf(internal/server): 调整清理过期记录任务的执行频率

- 将清理过期记录的任务执行频率从每分钟一次改为每小时一次
- 通过修改 Cron 表达式从 "* * * * *" 到 "0 * * * *" 实现了这一变更
fusu 1 week ago
parent
commit
a96da298a1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      internal/server/task.go

+ 1 - 1
internal/server/task.go

@@ -108,7 +108,7 @@ func (t *TaskServer) Start(ctx context.Context) error {
 	}
 
 
-	_, err = t.scheduler.Cron("* * * * *").Do(func() {
+	_, err = t.scheduler.Cron("0 * * * *").Do(func() {
 		err := t.wafTask.CleanUpStaleRecords(ctx)
 		if err != nil {
 			t.log.Error("清理过期记录失败", zap.Error(err))