| 
...
 | 
...
 | 
@@ -41,7 +41,7 @@ class HotMail { | 
| 
 | 
 | 
     private function start(){
 | 
| 
 | 
 | 
         _echo('启动预热邮件处理 '.getmypid());
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 //        if(redis()->add('hot_mail_sync',1,60)){
 | 
| 
 | 
 | 
         if(redis()->add('hot_mail_sync',1,60)){
 | 
| 
 | 
 | 
             $fob = $this->getFobHotEmail();
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             // 把黑格自己的也算进去
 | 
| 
...
 | 
...
 | 
@@ -63,35 +63,35 @@ class HotMail { | 
| 
 | 
 | 
                 }catch (Throwable $e){}
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 //            $maxId = $this->db->value("select `id` from `lists` order by `id` desc limit 1");
 | 
| 
 | 
 | 
 //            $id = 0;
 | 
| 
 | 
 | 
 //            while (1){
 | 
| 
 | 
 | 
 //                $ids = [];
 | 
| 
 | 
 | 
 //                for ($i=0;$i<1000;$i++){
 | 
| 
 | 
 | 
 //                    $ids[] = $i+$id;
 | 
| 
 | 
 | 
 //                }
 | 
| 
 | 
 | 
 //                $id = end($ids);
 | 
| 
 | 
 | 
 //
 | 
| 
 | 
 | 
 //                redis()->rPush('hot_check_ids',implode(',',$ids));
 | 
| 
 | 
 | 
 //
 | 
| 
 | 
 | 
 //                if($id>$maxId){
 | 
| 
 | 
 | 
 //                    break;
 | 
| 
 | 
 | 
 //                }
 | 
| 
 | 
 | 
 //            }
 | 
| 
 | 
 | 
             $maxId = $this->db->value("select `id` from `lists` order by `id` desc limit 1");
 | 
| 
 | 
 | 
             $id = 0;
 | 
| 
 | 
 | 
             while (1){
 | 
| 
 | 
 | 
                 $ids = [];
 | 
| 
 | 
 | 
                 for ($i=0;$i<1000;$i++){
 | 
| 
 | 
 | 
                     $ids[] = $i+$id;
 | 
| 
 | 
 | 
                 }
 | 
| 
 | 
 | 
                 $id = end($ids);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 //        }
 | 
| 
 | 
 | 
                 redis()->rPush('hot_check_ids',implode(',',$ids));
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                 if($id>$maxId){
 | 
| 
 | 
 | 
                     break;
 | 
| 
 | 
 | 
                 }
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 //        while (1){
 | 
| 
 | 
 | 
 //            $ids = redis()->lPop('hot_check_ids');
 | 
| 
 | 
 | 
 //            if($ids){
 | 
| 
 | 
 | 
 //                $ids = explode(',',$ids);
 | 
| 
 | 
 | 
 //                $this->run($ids);
 | 
| 
 | 
 | 
 //            }else{
 | 
| 
 | 
 | 
 //                echo '等待'.PHP_EOL;
 | 
| 
 | 
 | 
 //                co::sleep(2);
 | 
| 
 | 
 | 
 //            }
 | 
| 
 | 
 | 
 //        }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         while (1){
 | 
| 
 | 
 | 
             $ids = redis()->lPop('hot_check_ids');
 | 
| 
 | 
 | 
             if($ids){
 | 
| 
 | 
 | 
                 $ids = explode(',',$ids);
 | 
| 
 | 
 | 
                 $this->run($ids);
 | 
| 
 | 
 | 
             }else{
 | 
| 
 | 
 | 
                 echo '等待'.PHP_EOL;
 | 
| 
 | 
 | 
                 co::sleep(2);
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 
 | 
| 
...
 | 
...
 | 
@@ -174,7 +174,7 @@ swoole_set_process_name('hot-email-run-man'); | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 $pm = new Swoole\Process\Manager();
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 $pm->addBatch(1,function (){
 | 
| 
 | 
 | 
 $pm->addBatch(10,function (){
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
     swoole_set_process_name('hot-email-run');
 | 
| 
 | 
 | 
 
 | 
...
 | 
...
 | 
 |