作者 邓超

优化

@@ -41,7 +41,12 @@ $pm->addBatch(3,function (\Swoole\Process\Pool $pool, int $worker_id){ @@ -41,7 +41,12 @@ $pm->addBatch(3,function (\Swoole\Process\Pool $pool, int $worker_id){
41 41
42 try{ 42 try{
43 // 开始同步 43 // 开始同步
  44 + if(redis()->add('sync_my_day:'.date('d').'_'.$id,$id,86400)){
  45 + (new \Service\SyncMail('69125'))->setIsBody(false)->sync();
  46 + }else{
44 (new \Service\SyncMail($id))->setIsBody(false)->isUidAfter(2)->sync(); 47 (new \Service\SyncMail($id))->setIsBody(false)->isUidAfter(2)->sync();
  48 + }
  49 +
45 }catch (Throwable $e){ 50 }catch (Throwable $e){
46 _echo($e->getMessage()); 51 _echo($e->getMessage());
47 } 52 }