mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
feat(timer): ClearLog 清理天数改为从配置读取,支持 env 覆盖
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -14,8 +14,9 @@ class ClearLogBase extends TimerController
|
||||
|
||||
public function do()
|
||||
{
|
||||
Log::debug('清除3天的日志');
|
||||
Db::name('debug_log')->where('create_time', '<', time() - 60 * 60 * 24 * 3)->delete();
|
||||
$days = (int) config('timer.clear_log_days', 3);
|
||||
Log::debug('清除' . $days . '天的日志');
|
||||
Db::name('debug_log')->where('create_time', '<', time() - 60 * 60 * 24 * $days)->delete();
|
||||
|
||||
return 'success';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user