正在显示
2 个修改的文件
包含
16 行增加
和
0 行删除
| @@ -30,8 +30,19 @@ class AutoMail { | @@ -30,8 +30,19 @@ class AutoMail { | ||
| 30 | echo "\n"; | 30 | echo "\n"; |
| 31 | $at = 0; | 31 | $at = 0; |
| 32 | $this->es = es(); | 32 | $this->es = es(); |
| 33 | + $h = (int) date('H'); | ||
| 33 | while (true){ | 34 | while (true){ |
| 34 | $postid = redis()->lPop('resync_to_es_inbox_list'); | 35 | $postid = redis()->lPop('resync_to_es_inbox_list'); |
| 36 | + // 如果有增删 每天7点就开始自动刷 | ||
| 37 | + if($postid == '0a'){ | ||
| 38 | + if($h>18){ | ||
| 39 | + $postid = 0; | ||
| 40 | + }else{ | ||
| 41 | + redis()->rPush('resync_to_es_inbox_list','0a'); | ||
| 42 | + continue; | ||
| 43 | + } | ||
| 44 | + } | ||
| 45 | + | ||
| 35 | if (!is_numeric($postid)){ | 46 | if (!is_numeric($postid)){ |
| 36 | break; | 47 | break; |
| 37 | } | 48 | } |
| @@ -1138,6 +1138,11 @@ class Home extends Base { | @@ -1138,6 +1138,11 @@ class Home extends Base { | ||
| 1138 | */ | 1138 | */ |
| 1139 | public function resync_to_es(){ | 1139 | public function resync_to_es(){ |
| 1140 | $postid = (int) app()->request('postid'); | 1140 | $postid = (int) app()->request('postid'); |
| 1141 | + if(app()->request('postid')=='0a'){ | ||
| 1142 | + redis()->rPush('resync_to_es_inbox_list','0a'); | ||
| 1143 | + return; | ||
| 1144 | + } | ||
| 1145 | + | ||
| 1141 | if(redis()->has('resync_to_es_inbox:'.$postid)){ | 1146 | if(redis()->has('resync_to_es_inbox:'.$postid)){ |
| 1142 | app()->e('失败,请等待10分钟后在重试'); | 1147 | app()->e('失败,请等待10分钟后在重试'); |
| 1143 | } | 1148 | } |
-
请 注册 或 登录 后发表评论