...
|
...
|
@@ -30,7 +30,8 @@ class SyncToEsCmd { |
|
|
$es = (new Lib\Es\Es('hg_ai_emails'));
|
|
|
$db = db();
|
|
|
|
|
|
while (1){
|
|
|
$maxNum = 10000; // 最大执行数量
|
|
|
while ($maxNum > 0){
|
|
|
// 检查是否接收到信号
|
|
|
pcntl_signal_dispatch();
|
|
|
|
...
|
...
|
@@ -38,14 +39,12 @@ class SyncToEsCmd { |
|
|
_echo('已退出进程');
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$maxNum--;
|
|
|
$id = redis()->lPop('sync_to_es');
|
|
|
if($id){
|
|
|
$data = $db->first(\Model\listsSql::first('`id` = '.$id));
|
|
|
if($data){
|
|
|
// 设置 进程 是否在运行
|
|
|
redis()->set('sync_my_pid:'.getmypid(),time(),86400);
|
|
|
|
|
|
$data['is_auto']=$db->count('select count(*) from `lists_auto` where `list_id` = '.$data['id']) ? 1 : 0;
|
|
|
|
|
|
$data = $this->getEsData($data);
|
...
|
...
|
@@ -63,7 +62,6 @@ class SyncToEsCmd { |
|
|
}
|
|
|
|
|
|
echo '没有找到数据'.PHP_EOL;
|
|
|
sleep(1);
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
|