|
...
|
...
|
@@ -16,6 +16,7 @@ use App\Models\Template\BCustomTemplate; |
|
|
|
use App\Services\CosService;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Redis;
|
|
|
|
|
|
...
|
...
|
@@ -54,10 +55,14 @@ class HtmlCollect extends Command |
|
|
|
protected function start_collect()
|
|
|
|
{
|
|
|
|
$task_id = $this->get_task();
|
|
|
|
if (!$task_id) {
|
|
|
|
if ($task_id === false) {
|
|
|
|
//所有项目采集完成
|
|
|
|
sleep(60);
|
|
|
|
return true;
|
|
|
|
} elseif ($task_id === 0) {
|
|
|
|
//队列任务已处理完,有进程正在查询数据库,等待2秒后执行
|
|
|
|
sleep(2);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
$task_arr = explode('_', $task_id);
|
|
...
|
...
|
@@ -147,6 +152,11 @@ class HtmlCollect extends Command |
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!Cache::add('html_collect_select_mysql', true, 10)) {
|
|
|
|
//如果存在数据锁,表示有其他进程已往下执行,当前进程直接返回
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($update_log_list as $update_log) {
|
|
|
|
switch ($update_log->api_type) {
|
|
|
|
case 'page':
|
...
|
...
|
|