LD 5 лет назад
Родитель
Сommit
ba5deca594
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      app/Console/Commands/LogExpireDelete.php

+ 1 - 0
app/Console/Commands/LogExpireDelete.php

@@ -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');
     }
 }