正在显示
1 个修改的文件
包含
5 行增加
和
5 行删除
| @@ -147,16 +147,16 @@ class HtmlCollect extends Command | @@ -147,16 +147,16 @@ class HtmlCollect extends Command | ||
| 147 | return $task_id; | 147 | return $task_id; |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | - if (!Cache::add('html_collect_select_mysql', true, 10)) { | ||
| 151 | - // 如果存在数据锁,则表示有其他进程正在查询数据库,直接返回 | ||
| 152 | - return 0; | ||
| 153 | - } | ||
| 154 | - | ||
| 155 | $update_log_list = UpdateLog::where('status', UpdateLog::STATUS_COM)->where('collect_status', UpdateLog::COLLECT_STATUS_UN)->orderBy('updated_at', 'asc')->limit(20)->get(); | 150 | $update_log_list = UpdateLog::where('status', UpdateLog::STATUS_COM)->where('collect_status', UpdateLog::COLLECT_STATUS_UN)->orderBy('updated_at', 'asc')->limit(20)->get(); |
| 156 | if ($update_log_list->count() == 0) { | 151 | if ($update_log_list->count() == 0) { |
| 157 | return false; | 152 | return false; |
| 158 | } | 153 | } |
| 159 | 154 | ||
| 155 | + if (!Cache::add('html_collect_select_mysql', true, 10)) { | ||
| 156 | + //如果存在数据锁,表示有其他进程已往下执行,当前进程直接返回 | ||
| 157 | + return 0; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | foreach ($update_log_list as $update_log) { | 160 | foreach ($update_log_list as $update_log) { |
| 161 | switch ($update_log->api_type) { | 161 | switch ($update_log->api_type) { |
| 162 | case 'page': | 162 | case 'page': |
-
请 注册 或 登录 后发表评论