Skip to content
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

fix: worker_threads mode without ports #103

Merged
merged 1 commit into from
Dec 19, 2022
Merged

Conversation

sjfkai
Copy link
Contributor

@sjfkai sjfkai commented Dec 16, 2022

fix: worker_threads 模式下,指定 port 不指定 ports 时, port 不生效的问题

  • 复现方式:
$ PORT=8080 egg-scripts start --title=egg-server-xxx --workers=1 --startMode worker_threads
  • 实际结果:

监听7001端口

  • 期望结果:

监听8080端口

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@fengmk2 fengmk2 requested a review from hyj1991 December 16, 2022 13:06
@fengmk2
Copy link
Member

fengmk2 commented Dec 16, 2022

目前线程模式没法监听同一个端口。

@sjfkai
Copy link
Contributor Author

sjfkai commented Dec 19, 2022

目前线程模式没法监听同一个端口。

不是监听同一个端口的问题。而是没有传 ports 参数时,port参数也没有生效的问题。

这个改动是当没有指定 ports 却指定了 port 时, ports 默认为 [port]

@fengmk2 fengmk2 added the bug label Dec 19, 2022
@codecov
Copy link

codecov bot commented Dec 19, 2022

Codecov Report

Base: 93.51% // Head: 93.53% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (dffbf67) compared to base (5a656e4).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
+ Coverage   93.51%   93.53%   +0.01%     
==========================================
  Files          12       12              
  Lines         787      789       +2     
  Branches      119      119              
==========================================
+ Hits          736      738       +2     
  Misses         51       51              
Impacted Files Coverage Δ
lib/utils/mode/impl/worker_threads/app.js 69.41% <100.00%> (+0.73%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fengmk2 fengmk2 merged commit a088e99 into eggjs:master Dec 19, 2022
atian25 pushed a commit that referenced this pull request Dec 19, 2022
[skip ci]

## [2.0.1](v2.0.0...v2.0.1) (2022-12-19)

### Bug Fixes

* worker_threads mode without ports ([#103](#103)) ([a088e99](a088e99))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants