|
|
@@ -47,5 +47,6 @@ class LogExpireDelete extends Command
|
|
|
$expire_duration=config('logging.expire_duration');//保留的日志天数
|
|
|
$date=Carbon::now()->subDays($expire_duration)->format('Y-m-d');
|
|
|
DB::table('logs')->where('created_at','<',$date)->delete();
|
|
|
+ DB::statement('OPTIMIZE TABLE logs');
|
|
|
}
|
|
|
}
|