作者 lyh
... ... @@ -40,15 +40,14 @@ class HtmlCollect extends Command
public function handle()
{
// while (true) {
while (true) {
$this->start_collect();
// }
}
}
protected function start_collect()
{
// $task_id = $this->get_task();
$task_id = '543_1';
$task_id = $this->get_task();
if ($task_id === false) {
//所有项目采集完成
sleep(60);
... ...
... ... @@ -296,7 +296,7 @@ class ProjectUpdate extends Command
$id = $model->insertGetId([
'project_id' => $project_id,
'title' => $item['ttile'],
'intro' => $item['description'] ?? '',
'intro' => $item['short_description'] ?? '',
'content' => $item['content'] ?? '',
'category_id' => $category_id,
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
... ... @@ -462,6 +462,9 @@ class ProjectUpdate extends Command
DB::disconnect('custom_mysql');
$task->status = UpdateLog::STATUS_COM;//同步完成
if($api_type == 'post' || $api_type == 'page' || $api_type == 'news' || $api_type == 'blog'){
$task->collect_status = UpdateLog::COLLECT_STATUS_UN;
}
$task->save();
echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', task_type: ' . $api_type . ', update end ' . PHP_EOL;
... ...