正在显示
2 个修改的文件
包含
12 行增加
和
0 行删除
| @@ -95,6 +95,12 @@ class HtmlCollect extends Command | @@ -95,6 +95,12 @@ class HtmlCollect extends Command | ||
| 95 | //采集html页面,下载资源到本地并替换 | 95 | //采集html页面,下载资源到本地并替换 |
| 96 | try { | 96 | try { |
| 97 | $html = curl_c('https://' . $collect_info->domain . $collect_info->route, false); | 97 | $html = curl_c('https://' . $collect_info->domain . $collect_info->route, false); |
| 98 | + if($html == '0'){ | ||
| 99 | + $collect_info->status = CollectTask::STATUS_FAIL; | ||
| 100 | + $collect_info->save(); | ||
| 101 | + return true; | ||
| 102 | + } | ||
| 103 | + | ||
| 98 | $source_list = $this->html_preg($html, $project_id, $collect_info->domain, $web_url_domain, $home_url); | 104 | $source_list = $this->html_preg($html, $project_id, $collect_info->domain, $web_url_domain, $home_url); |
| 99 | 105 | ||
| 100 | if ($source_list) { | 106 | if ($source_list) { |
| @@ -102,6 +102,12 @@ class HtmlLanguageCollect extends Command | @@ -102,6 +102,12 @@ class HtmlLanguageCollect extends Command | ||
| 102 | //采集html页面,下载资源到本地并替换 | 102 | //采集html页面,下载资源到本地并替换 |
| 103 | try { | 103 | try { |
| 104 | $html = curl_c('https://' . $collect_info->domain . $collect_info->route, false); | 104 | $html = curl_c('https://' . $collect_info->domain . $collect_info->route, false); |
| 105 | + if($html == '0'){ | ||
| 106 | + $collect_info->status = CollectTask::STATUS_FAIL; | ||
| 107 | + $collect_info->save(); | ||
| 108 | + return true; | ||
| 109 | + } | ||
| 110 | + | ||
| 105 | $source_list = $this->html_preg($html, $project_id, $collect_info->domain, $web_url_domain, $home_url); | 111 | $source_list = $this->html_preg($html, $project_id, $collect_info->domain, $web_url_domain, $home_url); |
| 106 | 112 | ||
| 107 | if ($source_list) { | 113 | if ($source_list) { |
-
请 注册 或 登录 后发表评论