正在显示
1 个修改的文件
包含
4 行增加
和
19 行删除
@@ -33,30 +33,15 @@ class HotMail { | @@ -33,30 +33,15 @@ class HotMail { | ||
33 | * @time 2024/7/18 14:04 | 33 | * @time 2024/7/18 14:04 |
34 | */ | 34 | */ |
35 | private function start(){ | 35 | private function start(){ |
36 | - _echo('启动预热邮件处理 '.getmypid()); | 36 | + _echo('启动预热邮件处理 '); |
37 | 37 | ||
38 | if(redis()->add('hot_mail_sync2',1,60)){ | 38 | if(redis()->add('hot_mail_sync2',1,60)){ |
39 | - echo '正在计算数据'; | 39 | + _echo( '正在计算数据'); |
40 | $maxId = $this->db->value("select `id` from `lists` order by `id` desc limit 1"); | 40 | $maxId = $this->db->value("select `id` from `lists` order by `id` desc limit 1"); |
41 | - $id = 0; | ||
42 | - while (1){ | ||
43 | - $ids = []; | ||
44 | - for ($i=0;$i<1000;$i++){ | ||
45 | - $ids[] = $i+$id; | ||
46 | - } | ||
47 | - $id = end($ids); | ||
48 | - | ||
49 | - if($id<($maxId-200000)){ | ||
50 | - continue; | ||
51 | - } | ||
52 | - | 41 | + foreach (minMaxToArray($maxId-100000,$maxId) as $ids){ |
53 | redis()->rPush('hot_check_ids',implode(',',$ids)); | 42 | redis()->rPush('hot_check_ids',implode(',',$ids)); |
54 | - | ||
55 | - if($id>$maxId){ | ||
56 | - break; | ||
57 | - } | ||
58 | } | 43 | } |
59 | - echo '计算完成'; | 44 | + _echo( '计算完成'); |
60 | redis()->delete('hot_mail_sync2'); | 45 | redis()->delete('hot_mail_sync2'); |
61 | } | 46 | } |
62 | 47 |
-
请 注册 或 登录 后发表评论