diff --git a/app/tools/controller/timer/LogClean.php b/app/tools/controller/timer/LogClean.php new file mode 100644 index 0000000..d3667e1 --- /dev/null +++ b/app/tools/controller/timer/LogClean.php @@ -0,0 +1,11 @@ + 600, 'concurrency' => 1, ], + [ + 'name' => 'timer_log_clean', + 'type' => 'site', + 'target' => '/tools/timer.LogClean/do', + 'frequency' => 86400, + 'concurrency' => 1, + ], ]; diff --git a/extend/base/tools/controller/timer/LogCleanBase.php b/extend/base/tools/controller/timer/LogCleanBase.php new file mode 100644 index 0000000..9ab6850 --- /dev/null +++ b/extend/base/tools/controller/timer/LogCleanBase.php @@ -0,0 +1,25 @@ +where('create_time', '<', $threshold) + ->delete(); + + return "已清理 {$count} 条超过 {$days} 天的定时器执行日志。"; + } +}