正在显示
1 个修改的文件
包含
17 行增加
和
4 行删除
@@ -37,10 +37,23 @@ function start(){ | @@ -37,10 +37,23 @@ function start(){ | ||
37 | $goNum++; | 37 | $goNum++; |
38 | try{ | 38 | try{ |
39 | // 开始同步 | 39 | // 开始同步 |
40 | - (new \Service\SyncMail($id))->search( | ||
41 | - (new \Lib\Imap\ImapSearch()) | ||
42 | - ->dateGt(date('Y-m-d',strtotime("-2 day"))) | ||
43 | - )->sync(); | 40 | + $email = db()->cache(3600)->first(\Model\emailSql::first($id)); |
41 | + if($email){ | ||
42 | + $sync = new \Service\SyncMail($email); | ||
43 | + if(db()->count("select count(*) from `hot_mail` where `email` = '{$email['email']}'")){ | ||
44 | + // ai邮件只同步2天内的 | ||
45 | + $sync->search( | ||
46 | + (new \Lib\Imap\ImapSearch()) | ||
47 | + ->dateGt(date('Y-m-d',strtotime("-2 day"))) | ||
48 | + ); | ||
49 | + } | ||
50 | + | ||
51 | + $sync->sync(); | ||
52 | + | ||
53 | + $sync = null; | ||
54 | + unset($sync); | ||
55 | + } | ||
56 | + | ||
44 | }catch (Throwable $e){ | 57 | }catch (Throwable $e){ |
45 | logs('sync : '.$e->getMessage()); | 58 | logs('sync : '.$e->getMessage()); |
46 | } | 59 | } |
-
请 注册 或 登录 后发表评论