Skip to content

Conversation

XadillaX
Copy link
Member

@XadillaX XadillaX commented Aug 7, 2018

Checklist
  • npm test passes
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@XadillaX XadillaX requested a review from atian25 August 7, 2018 08:41
@XadillaX XadillaX force-pushed the refactor-start-spawn branch from 0f0c0b8 to 21c120b Compare August 7, 2018 08:44
@atian25 atian25 requested a review from popomore August 7, 2018 08:46
} else {
// signal event had been handler at common-bin helper
this.helper.spawn('node', eggArgs, options);
options.stdio = options.stdio || 'inherit';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是不需要这个配置了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来的有什么问题?为什么不在 helper.spawn 加参数实现,而又在这里实现重复的逻辑代码?
背景问题是什么?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fengmk2 要暴露出 child 对象供上层监听使用。我跟天猪讨论后的方案有:

  1. 暴露出 helper 里面的 childs
  2. helper 里面年久失修,重构估计会变成 break,所以直接这一块逻辑替换。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helper 返回 child 不行?

Copy link
Member Author

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 => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看起来好像这个库不支持 cp.spawn()

@codecov
Copy link

codecov bot commented Aug 9, 2018

Codecov Report

Merging #23 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #23   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           6      6           
  Lines         190    203   +13     
=====================================
+ Hits          190    203   +13
Impacted Files Coverage Δ
lib/cmd/start.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22faa4c...edcca1d. Read the comment docs.

@popomore popomore merged commit e07726c into eggjs:master Aug 9, 2018
@popomore
Copy link
Member

popomore commented Aug 9, 2018

忘记发了,明天发

@popomore
Copy link
Member

  • egg-scripts@2.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants