...
|
...
|
@@ -29,17 +29,21 @@ class AutoMail { |
|
|
echo date('Y-m-d H:i:s');
|
|
|
echo "\n";
|
|
|
$at = 0;
|
|
|
if(redis()->get('resync_to_es_inbox') == 1){
|
|
|
|
|
|
redis()->set('resync_to_es_inbox',2,3600);
|
|
|
|
|
|
$this->es = es();
|
|
|
while (true){
|
|
|
$postid = redis()->lPop('resync_to_es_inbox_list');
|
|
|
if (!is_numeric($postid)){
|
|
|
break;
|
|
|
}
|
|
|
if(redis()->add('resync_to_es_inbox:'.$postid,1,$postid?600:7200)){
|
|
|
if (!$postid){
|
|
|
$post_ids = fob_mysql()->all("select `post_id` from `e_mail_binds` group by `post_id`");
|
|
|
|
|
|
if($post_ids){
|
|
|
$post_ids = array_column($post_ids,'post_id','post_id');
|
|
|
}
|
|
|
|
|
|
$this->es = es();
|
|
|
}else{
|
|
|
$post_ids = [$postid];
|
|
|
}
|
|
|
|
|
|
foreach ($post_ids as $post_id){
|
|
|
$total = $this->essss(0,$post_id,0);
|
...
|
...
|
@@ -48,8 +52,10 @@ class AutoMail { |
|
|
$at += $total + $autoTotal;
|
|
|
}
|
|
|
|
|
|
redis()->set('resync_to_es_inbox',2,600);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
echo "总数量 {$at} ";
|
|
|
echo "end ";
|
|
|
echo date('Y-m-d H:i:s');
|
...
|
...
|
|