作者 邓超

优化同步

... ... @@ -251,6 +251,7 @@ class SyncMail {
/********************* 同步邮件 **********************/
$syncNum = [];
// 循环文件夹
$startTime = time();
foreach ($folders->all() as $f){
if($this->isStop) return;
... ... @@ -262,13 +263,13 @@ class SyncMail {
$num = $this->mail($folder);
if($num){
$syncNum[$folder->getName()] = $num;
_echo($this->emailId().' ===> '.$folder->getName().' ===> '.$num);
// _echo($this->emailId().' ===> '.$folder->getName().' ===> '.$num);
}
}
}
}
_echo($this->emailId()."=>runTime:".(time()-$startTime).'s => total: '.(array_sum($syncNum)));
return $syncNum;
}
... ...