作者 刘锟

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

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