This commit is contained in:
2021-03-02 13:49:06 +08:00
parent 25aa3fd320
commit 66543b8274
2 changed files with 16 additions and 9 deletions
+5 -1
View File
@@ -167,7 +167,11 @@ class Logger extends Component
$files = glob(storage(null, $dirName) . '/*');
if (count($files) >= 15) {
Coroutine\System::exec('find ' . storage(null, $dirName) . '/ -mtime +15 -name "*.log" -exec rm -rf {} \;');
$command = 'find ' . storage(null, $dirName) . '/ -mtime +15 -name "*.log" -exec rm -rf {} \;';
if (Context::inCoroutine())
Coroutine\System::exec($command);
else
exec($command);
}
}