diff --git a/.gitignore b/.gitignore index 7730aa6..7f075b6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ run .tmp *.log .vscode -.nyc_output \ No newline at end of file +.nyc_output +package-lock.json +.package-lock.json diff --git a/README.md b/README.md index cd1bccc..2d800f0 100644 --- a/README.md +++ b/README.md @@ -71,16 +71,8 @@ EGG_AGENT_CLOSE_TIMEOUT: agent worker boot timeout value [MIT](LICENSE) - - ## Contributors -|[
popomore](https://github.com/popomore)
|[
fengmk2](https://github.com/fengmk2)
|[
atian25](https://github.com/atian25)
|[
dead-horse](https://github.com/dead-horse)
|[
killagu](https://github.com/killagu)
|[
semantic-release-bot](https://github.com/semantic-release-bot)
| -| :---: | :---: | :---: | :---: | :---: | :---: | -|[
ngot](https://github.com/ngot)
|[
hyj1991](https://github.com/hyj1991)
|[
whxaxes](https://github.com/whxaxes)
|[
iyuq](https://github.com/iyuq)
|[
nightink](https://github.com/nightink)
|[
mansonchor](https://github.com/mansonchor)
| -|[
ImHype](https://github.com/ImHype)
|[
gxcsoccer](https://github.com/gxcsoccer)
|[
waitingsong](https://github.com/waitingsong)
|[
sjfkai](https://github.com/sjfkai)
|[
ahungrynoob](https://github.com/ahungrynoob)
|[
qingdengyue](https://github.com/qingdengyue)
| -[
wenjiasen](https://github.com/wenjiasen)
|[
czy88840616](https://github.com/czy88840616)
|[
gxkl](https://github.com/gxkl)
- -This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Mon Jun 03 2024 10:59:15 GMT+0800`. +[![Contributors](https://contrib.rocks/image?repo=eggjs/egg-cluster)](https://github.com/eggjs/egg-cluster/graphs/contributors) - +Made with [contributors-img](https://contrib.rocks). diff --git a/lib/master.js b/lib/master.js index 2dc1c20..9e5ee98 100644 --- a/lib/master.js +++ b/lib/master.js @@ -7,7 +7,7 @@ const path = require('path'); const fs = require('fs'); const EventEmitter = require('events'); const ready = require('get-ready'); -const GetFreePort = require('detect-port'); +const { detectPort } = require('detect-port'); const ConsoleLogger = require('egg-logger').EggConsoleLogger; const utility = require('utility'); const terminalLink = require('terminal-link'); @@ -216,12 +216,12 @@ class Master extends EventEmitter { detectPorts() { // Detect cluster client port - return GetFreePort() + return detectPort() .then(port => { this.options.clusterPort = port; // If sticky mode, detect worker port if (this.options.sticky) { - return GetFreePort(); + return detectPort(); } }) .then(port => { diff --git a/package.json b/package.json index 02f807f..c1cb817 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ "test": "npm run lint -- --fix && npm run test-local", "test-local": "egg-bin test --ts false", "cov": "egg-bin cov --prerequire --timeout 100000 --ts false", - "ci": "npm run lint && npm run cov", - "contributor": "git-contributor" + "ci": "npm run lint && npm run cov" }, "files": [ "index.js", @@ -34,7 +33,7 @@ "await-event": "^2.1.0", "cfork": "^1.7.1", "cluster-reload": "^1.0.2", - "detect-port": "^1.3.0", + "detect-port": "^2.0.1", "egg-logger": "^3.3.0", "egg-utils": "^2.4.1", "get-ready": "^2.0.1", @@ -54,7 +53,6 @@ "egg-mock": "^5.4.0", "eslint": "^8.26.0", "eslint-config-egg": "^12.1.0", - "git-contributor": "^2.1.5", "pedding": "^1.1.0", "supertest": "^4.0.0", "ts-node": "^10.9.1",