|
...
|
...
|
@@ -51,7 +51,7 @@ class InitProject extends Command |
|
|
|
$list = NoticeLog::where('type', NoticeLog::TYPE_INIT_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get();
|
|
|
|
foreach ($list as $item){
|
|
|
|
echo 'start:' . $item['id'] . PHP_EOL;
|
|
|
|
// try {
|
|
|
|
try {
|
|
|
|
$project = Project::find($item['data']['project_id']);
|
|
|
|
$project_logic = new ProjectLogic();
|
|
|
|
//初始化数据库
|
|
...
|
...
|
@@ -70,11 +70,11 @@ class InitProject extends Command |
|
|
|
$item->status = NoticeLog::STATUS_SUCCESS;
|
|
|
|
$item->save();
|
|
|
|
echo 'success:' . $item['id'] . PHP_EOL;
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
|
|
|
|
// errorLog('项目初始化失败', $item, $e);
|
|
|
|
// $this->retry($item, $e->getMessage());
|
|
|
|
// }
|
|
|
|
}catch (\Exception $e){
|
|
|
|
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
|
|
|
|
errorLog('项目初始化失败', $item, $e);
|
|
|
|
$this->retry($item, $e->getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sleep(2);
|
|
|
|
}
|
...
|
...
|
|