正在显示
1 个修改的文件
包含
6 行增加
和
6 行删除
| @@ -51,7 +51,7 @@ class InitProject extends Command | @@ -51,7 +51,7 @@ class InitProject extends Command | ||
| 51 | $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get(); | 51 | $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get(); |
| 52 | foreach ($list as $item){ | 52 | foreach ($list as $item){ |
| 53 | echo 'start:' . $item['id'] . PHP_EOL; | 53 | echo 'start:' . $item['id'] . PHP_EOL; |
| 54 | -// try { | 54 | + try { |
| 55 | $project = Project::find($item['data']['project_id']); | 55 | $project = Project::find($item['data']['project_id']); |
| 56 | $project_logic = new ProjectLogic(); | 56 | $project_logic = new ProjectLogic(); |
| 57 | //初始化数据库 | 57 | //初始化数据库 |
| @@ -70,11 +70,11 @@ class InitProject extends Command | @@ -70,11 +70,11 @@ class InitProject extends Command | ||
| 70 | $item->status = NoticeLog::STATUS_SUCCESS; | 70 | $item->status = NoticeLog::STATUS_SUCCESS; |
| 71 | $item->save(); | 71 | $item->save(); |
| 72 | echo 'success:' . $item['id'] . PHP_EOL; | 72 | echo 'success:' . $item['id'] . PHP_EOL; |
| 73 | -// }catch (\Exception $e){ | ||
| 74 | -// echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL; | ||
| 75 | -// errorLog('项目初始化失败', $item, $e); | ||
| 76 | -// $this->retry($item, $e->getMessage()); | ||
| 77 | -// } | 73 | + }catch (\Exception $e){ |
| 74 | + echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL; | ||
| 75 | + errorLog('项目初始化失败', $item, $e); | ||
| 76 | + $this->retry($item, $e->getMessage()); | ||
| 77 | + } | ||
| 78 | } | 78 | } |
| 79 | sleep(2); | 79 | sleep(2); |
| 80 | } | 80 | } |
-
请 注册 或 登录 后发表评论