作者 邓超

x

正在显示 1 个修改的文件 包含 17 行增加4 行删除
... ... @@ -37,10 +37,23 @@ function start(){
$goNum++;
try{
// 开始同步
(new \Service\SyncMail($id))->search(
(new \Lib\Imap\ImapSearch())
->dateGt(date('Y-m-d',strtotime("-2 day")))
)->sync();
$email = db()->cache(3600)->first(\Model\emailSql::first($id));
if($email){
$sync = new \Service\SyncMail($email);
if(db()->count("select count(*) from `hot_mail` where `email` = '{$email['email']}'")){
// ai邮件只同步2天内的
$sync->search(
(new \Lib\Imap\ImapSearch())
->dateGt(date('Y-m-d',strtotime("-2 day")))
);
}
$sync->sync();
$sync = null;
unset($sync);
}
}catch (Throwable $e){
logs('sync : '.$e->getMessage());
}
... ...