mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进日志写入并发问题
This commit is contained in:
@@ -86,7 +86,10 @@ class File
|
|||||||
{
|
{
|
||||||
//检测日志文件大小,超过配置大小则备份日志文件重新生成
|
//检测日志文件大小,超过配置大小则备份日志文件重新生成
|
||||||
if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) {
|
if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) {
|
||||||
rename($destination, dirname($destination) . DS . time() . '-' . basename($destination));
|
try {
|
||||||
|
rename($destination, dirname($destination) . DS . time() . '-' . basename($destination));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
}
|
||||||
$this->writed[$destination] = false;
|
$this->writed[$destination] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user