|
@@ -29,17 +29,21 @@ class AutoMail { |
|
@@ -29,17 +29,21 @@ class AutoMail { |
29
|
echo date('Y-m-d H:i:s');
|
29
|
echo date('Y-m-d H:i:s');
|
30
|
echo "\n";
|
30
|
echo "\n";
|
31
|
$at = 0;
|
31
|
$at = 0;
|
32
|
- if(redis()->get('resync_to_es_inbox') == 1){
|
|
|
33
|
-
|
|
|
34
|
- redis()->set('resync_to_es_inbox',2,3600);
|
|
|
35
|
-
|
32
|
+ $this->es = es();
|
|
|
33
|
+ while (true){
|
|
|
34
|
+ $postid = redis()->lPop('resync_to_es_inbox_list');
|
|
|
35
|
+ if (!is_numeric($postid)){
|
|
|
36
|
+ break;
|
|
|
37
|
+ }
|
|
|
38
|
+ if(redis()->add('resync_to_es_inbox:'.$postid,1,$postid?600:7200)){
|
|
|
39
|
+ if (!$postid){
|
36
|
$post_ids = fob_mysql()->all("select `post_id` from `e_mail_binds` group by `post_id`");
|
40
|
$post_ids = fob_mysql()->all("select `post_id` from `e_mail_binds` group by `post_id`");
|
37
|
-
|
|
|
38
|
if($post_ids){
|
41
|
if($post_ids){
|
39
|
$post_ids = array_column($post_ids,'post_id','post_id');
|
42
|
$post_ids = array_column($post_ids,'post_id','post_id');
|
40
|
}
|
43
|
}
|
41
|
-
|
|
|
42
|
- $this->es = es();
|
44
|
+ }else{
|
|
|
45
|
+ $post_ids = [$postid];
|
|
|
46
|
+ }
|
43
|
|
47
|
|
44
|
foreach ($post_ids as $post_id){
|
48
|
foreach ($post_ids as $post_id){
|
45
|
$total = $this->essss(0,$post_id,0);
|
49
|
$total = $this->essss(0,$post_id,0);
|
|
@@ -48,8 +52,10 @@ class AutoMail { |
|
@@ -48,8 +52,10 @@ class AutoMail { |
48
|
$at += $total + $autoTotal;
|
52
|
$at += $total + $autoTotal;
|
49
|
}
|
53
|
}
|
50
|
|
54
|
|
51
|
- redis()->set('resync_to_es_inbox',2,600);
|
|
|
52
|
}
|
55
|
}
|
|
|
56
|
+
|
|
|
57
|
+ }
|
|
|
58
|
+
|
53
|
echo "总数量 {$at} ";
|
59
|
echo "总数量 {$at} ";
|
54
|
echo "end ";
|
60
|
echo "end ";
|
55
|
echo date('Y-m-d H:i:s');
|
61
|
echo date('Y-m-d H:i:s');
|