-
Notifications
You must be signed in to change notification settings - Fork 37
refactor: raw spawn call to instead of helper.spawn in start non-daemon mode #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0f0c0b8
to
21c120b
Compare
} else { | ||
// signal event had been handler at common-bin helper | ||
this.helper.spawn('node', eggArgs, options); | ||
options.stdio = options.stdio || 'inherit'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是不是不需要这个配置了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原来的有什么问题?为什么不在 helper.spawn 加参数实现,而又在这里实现重复的逻辑代码?
背景问题是什么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fengmk2 要暴露出 child
对象供上层监听使用。我跟天猪讨论后的方案有:
- 暴露出
helper
里面的childs
; helper
里面年久失修,重构估计会变成 break,所以直接这一块逻辑替换。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helper 返回 child 不行?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helper
里面是一个 Promise,要等子进程结束后才会被 resolve
。
|
||
// attach master signal to child | ||
let signal; | ||
[ 'SIGINT', 'SIGQUIT', 'SIGTERM' ].forEach(event => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看起来好像这个库不支持 cp.spawn()
?
Codecov Report
@@ Coverage Diff @@
## master #23 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 6 6
Lines 190 203 +13
=====================================
+ Hits 190 203 +13
Continue to review full report at Codecov.
|
忘记发了,明天发 |
|
Checklist
npm test
passesAffected core subsystem(s)
Description of change