作者 邓超

重新同步

... ... @@ -30,8 +30,19 @@ class AutoMail {
echo "\n";
$at = 0;
$this->es = es();
$h = (int) date('H');
while (true){
$postid = redis()->lPop('resync_to_es_inbox_list');
// 如果有增删 每天7点就开始自动刷
if($postid == '0a'){
if($h>18){
$postid = 0;
}else{
redis()->rPush('resync_to_es_inbox_list','0a');
continue;
}
}
if (!is_numeric($postid)){
break;
}
... ...
... ... @@ -1138,6 +1138,11 @@ class Home extends Base {
*/
public function resync_to_es(){
$postid = (int) app()->request('postid');
if(app()->request('postid')=='0a'){
redis()->rPush('resync_to_es_inbox_list','0a');
return;
}
if(redis()->has('resync_to_es_inbox:'.$postid)){
app()->e('失败,请等待10分钟后在重试');
}
... ...