作者 邓超

x

... ... @@ -37,7 +37,10 @@ function start(){
$goNum++;
try{
// 开始同步
(new \Service\SyncMail($id))->sync();
(new \Service\SyncMail($id))->search(
(new \Lib\Imap\ImapSearch())
->date(date('Y-m-d',strtotime("-3 day")))
)->sync();
}catch (Throwable $e){
logs('sync : '.$e->getMessage());
}
... ...
... ... @@ -310,13 +310,13 @@ class SyncMail {
foreach ($uids as $k=>$uid){
// $has = redis()->get('h_'.$folder_id.'_'.$uid,function () use ($folder_id,$uid){
$num = redis()->get('h_'.$folder_id.'_'.$uid,function () use ($folder_id,$uid){
$num = $this->db->value(listsSql::first(dbWhere(['email_id'=>$this->emailId(),'folder_id'=>$folder_id,'uid'=>$uid]),'count(*) as c'));
// if($num){
// redis()->set('h_'.$folder_id.'_'.$uid,1,86400);
// }
// return $num;
// });
if($num){
redis()->set('h_'.$folder_id.'_'.$uid,1,86400);
}
return $num;
});
if($num){
unset($uids[$k]);
... ...