diff --git a/app/admin/sys.php b/app/admin/sys.php index 90da9167c..0284c7486 100644 --- a/app/admin/sys.php +++ b/app/admin/sys.php @@ -27,8 +27,10 @@ app()->event->listen('HttpEnd', function () { app()->db->name('SystemOplog')->insertAll($items); } $GLOBALS['oplogs'] = []; - $lastdate = date('Y-m-d H:i:s', strtotime('-7days')); - app()->db->name('SystemOplog')->where('create_at', '<', $lastdate)->delete(); + if (rand(1, 100) <= 10) { + $lastdate = date('Y-m-d H:i:s', strtotime('-7days')); + app()->db->name('SystemOplog')->where('create_at', '<', $lastdate)->delete(); + } } });