mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
并不需要每次都去清理日志,十分之一概率
This commit is contained in:
parent
da666da9ab
commit
84a8c3ab2e
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user