作者 邓超

预热邮件

正在显示 1 个修改的文件 包含 10 行增加2 行删除
@@ -22,9 +22,17 @@ function start(){ @@ -22,9 +22,17 @@ function start(){
22 include_once __DIR__."/../vendor/autoload.php"; 22 include_once __DIR__."/../vendor/autoload.php";
23 _echo("业务进程({$worker_id})启动成功"); 23 _echo("业务进程({$worker_id})启动成功");
24 24
  25 + $start_time = time();
  26 +
25 $goNum = 0; 27 $goNum = 0;
26 // 循环阻塞 28 // 循环阻塞
27 while (true){ 29 while (true){
  30 + if($start_time+43200 > time()){
  31 + if($start_time+43400 > time()){
  32 + break;
  33 + }
  34 + co::sleep(1);
  35 + }
28 while ($goNum > 50){ 36 while ($goNum > 50){
29 co::sleep(0.5); 37 co::sleep(0.5);
30 continue; 38 continue;
@@ -77,10 +85,10 @@ function start(){ @@ -77,10 +85,10 @@ function start(){
77 //每次都暂停1秒,防止同一时间启动太多的任务 85 //每次都暂停1秒,防止同一时间启动太多的任务
78 co::sleep(1); 86 co::sleep(1);
79 87
80 -  
81 -  
82 } 88 }
83 89
  90 + return 0;
  91 +
84 },true); 92 },true);
85 93
86 94