Uh oh!
There was an error while loading. Please reload this page.
Conversation
1. check whether stderr contains log 1. check starting time, the maximum is 300s 1. wait app start and exit
| }; | ||
| this.logger.info(`starting egg application at ${baseDir}`); | ||
| this.logger.info(`Starting egg application at ${baseDir}`); |
| while (true) { | ||
| const stat = yield fs.stat(stderr); | ||
| if (stat && stat.size > 0) { | ||
| const [ stdout ] = yield exec('tail -n 100 ' + stderr); |
There was a problem hiding this comment.
There was a problem hiding this comment.
话说,换个思路的话,master 有错误的时候, emit 一个 message 给 parent ?
There was a problem hiding this comment.
这个不是功能性的,是体验优化。可以在部署日志里面大致看到错误,而不用上服务器看日志。
master 也没有 app 和 agent 的错误,不知道是谁打的。
| const [ stdout ] = yield exec('tail -n 100 ' + stderr); | ||
| this.logger.error(stdout); | ||
| this.logger.error('Start failed, see %s', stderr); | ||
| this.child.kill('SIGTERM'); |
There was a problem hiding this comment.
warning 日志是在 stdout 吧?
v8 debug 的那个启动日志好像是会跑去 stderr 的,不过应该不会用这个来 debug
| if (this.isReady) return; | ||
| if (count >= timeout) { | ||
| // 启动超时,提示查看 chair-web.log 日志 |
Codecov Report
@@ Coverage Diff @@## master #9 +/- ##
==========================================
+ Coverage 97.7% 98.78% +1.07%
==========================================
Files 6 6 Lines 131 165 +34 ==========================================
+ Hits 128 163 +35 + Misses 3 2 -1
Continue to review full report at Codecov.
|
popomore
commented
Oct 12, 2017
@atian25 还有哪些要改的 |
popomore
commented
Oct 12, 2017
README 不是写着 windows 不支持吗 |
popomore
commented
Oct 12, 2017
starting 的时候最好能取到 framework 的名字 |
atian25
commented
Oct 12, 2017
不是有 getFramework 了么? 读下 package.json 然后 print 下?
只是写着 stop 不支持吧? 如果 start 也不支持的话,README 和 egg docs 都要改下。 +1 |
popomore
commented
Oct 12, 2017
@atian25 这个需要发 break 吗 |
| deploy tool for egg project. | ||
| **Note: Windows is not supported** | ||
| // nothing | ||
| } | ||
| if (stat && stat.size > 0) { | ||
| const [ stdout ] = yield exec('tail -n 100 ' + stderr); |
There was a problem hiding this comment.
要不然这里兼容下,win 打个 warning 提示不再兼容,跳过这段逻辑
| }); | ||
| // check start status | ||
| yield this.checkStatus(argv); |
There was a problem hiding this comment.
这里直接用 getRotatelog(argv.stderr) 返回的流?就不用读文件了?
popomore
commented
Oct 12, 2017
那问题可以合并了 |
| timeout: { | ||
| description: 'a timeout for start when daemon', | ||
| type: 'number', | ||
| default: 300, |
popomore
commented
Oct 13, 2017
改了 |
atian25
commented
Oct 13, 2017
你发 major 吧,然后 egg docs 那边也要改下 |
popomore
commented
Oct 13, 2017
|
Checklist
npm testpassesAffected core subsystem(s)
Description of change