|
@@ -62,22 +62,23 @@ class ReplaceHtml extends Command |
|
@@ -62,22 +62,23 @@ class ReplaceHtml extends Command |
|
62
|
while (true){
|
62
|
while (true){
|
|
63
|
$replaceHtmlModel = new TemplateReplaceHtml();
|
63
|
$replaceHtmlModel = new TemplateReplaceHtml();
|
|
64
|
$replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS]);
|
64
|
$replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS]);
|
|
65
|
- if(!empty($replaceHtmlList)){
|
|
|
|
66
|
- foreach ($replaceHtmlList as $v){
|
|
|
|
67
|
- ProjectServer::useProject($v['project_id']);
|
|
|
|
68
|
- echo '开始,任务id:'.$v['id'].PHP_EOL;
|
|
|
|
69
|
- if($v['source'] == 9){//单页面
|
|
|
|
70
|
- $count = $this->createReplacePageHtmlLog($v);
|
|
|
|
71
|
- }else{
|
|
|
|
72
|
- $count = $this->createReplaceHtmlLog($v);
|
|
|
|
73
|
- }
|
|
|
|
74
|
- //修改当前主任务状态为待执行
|
|
|
|
75
|
- $replaceHtmlModel->edit(['status'=>$replaceHtmlModel::STATUS_START,'total_num'=>$count],['id'=>$v['id']]);
|
|
|
|
76
|
- echo '结束'.PHP_EOL;
|
|
|
|
77
|
- DB::disconnect('custom_mysql');
|
65
|
+ if(empty($replaceHtmlList)){
|
|
|
|
66
|
+ sleep(100);
|
|
|
|
67
|
+ return true;
|
|
|
|
68
|
+ }
|
|
|
|
69
|
+ foreach ($replaceHtmlList as $v){
|
|
|
|
70
|
+ ProjectServer::useProject($v['project_id']);
|
|
|
|
71
|
+ echo '开始,任务id:'.$v['id'].PHP_EOL;
|
|
|
|
72
|
+ if($v['source'] == 9){//单页面
|
|
|
|
73
|
+ $count = $this->createReplacePageHtmlLog($v);
|
|
|
|
74
|
+ }else{
|
|
|
|
75
|
+ $count = $this->createReplaceHtmlLog($v);
|
|
78
|
}
|
76
|
}
|
|
|
|
77
|
+ //修改当前主任务状态为待执行
|
|
|
|
78
|
+ $replaceHtmlModel->edit(['status'=>$replaceHtmlModel::STATUS_START,'total_num'=>$count],['id'=>$v['id']]);
|
|
|
|
79
|
+ echo '结束'.PHP_EOL;
|
|
|
|
80
|
+ DB::disconnect('custom_mysql');
|
|
79
|
}
|
81
|
}
|
|
80
|
- sleep(5);
|
|
|
|
81
|
return true;
|
82
|
return true;
|
|
82
|
}
|
83
|
}
|
|
83
|
}
|
84
|
}
|