作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -64,7 +64,7 @@ class SyncProject extends Command
while (true){
$list = NoticeLog::where('type', NoticeLog::TYPE_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get();
foreach ($list as $item){
echo 'start:' . $item['id'] . PHP_EOL;
echo date('Y-m-d') . ' start:' . $item['id'] . PHP_EOL;
try {
$is_update = $item['data']['is_update']??0;//是否是4.0或5.0更新到6.0
$order_id = $item['data']['order_id'];
... ... @@ -97,7 +97,7 @@ class SyncProject extends Command
$item->save();
echo 'success:' . $item['id'] . PHP_EOL;
}catch (\Exception $e){
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
echo 'error:' . $item['id'] . $e->getMessage() .' line ' . $e->getLine() . PHP_EOL;
errorLog('项目同步失败', $item, $e);
$this->retry($item, $e->getMessage());
}
... ...
... ... @@ -134,11 +134,12 @@ class UpdateSeoTdk extends Command
{
while (true) {
$task = ProjectUpdateTdk::getPendingTask();
$project_id = $task->project_id;
if (!$project_id) {
if (!$task) {
sleep(10);
continue;
}
$project_id = $task->project_id;
echo date('Y-m-d H:i:s') . ' start project_id: ' . $project_id . PHP_EOL;
try {
ProjectServer::useProject($project_id);
... ...