Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Content Node on multiple cluster processes and migrate Bull->Bull…
…MQ (#3881)
- Loading branch information
Showing
42 changed files
with
1,500 additions
and
1,708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Folder contains patch files auto-generated by [patch-package](https://www.npmjs.com/package/patch-package). | ||
These are applied during `npm run postinstall` to modify dependencies in node_modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/node_modules/bullmq/dist/cjs/classes/child-pool.js b/node_modules/bullmq/dist/cjs/classes/child-pool.js | ||
index 2e47bee..0369e22 100644 | ||
--- a/node_modules/bullmq/dist/cjs/classes/child-pool.js | ||
+++ b/node_modules/bullmq/dist/cjs/classes/child-pool.js | ||
@@ -8,6 +8,16 @@ const process_utils_1 = require("./process-utils"); | ||
const interfaces_1 = require("../interfaces"); | ||
const utils_1 = require("../utils"); | ||
const CHILD_KILL_TIMEOUT = 30000; | ||
+ | ||
+const getFreePort = async () => { | ||
+ return new Promise((res) => { | ||
+ const srv = require("net").createServer(); | ||
+ srv.listen(0, () => { | ||
+ const port = srv.address().port; | ||
+ srv.close((err) => res(port)); | ||
+ }); | ||
+ }); | ||
+}; | ||
const convertExecArgv = async (execArgv) => { | ||
const standard = []; | ||
const convertedArgs = []; | ||
@@ -18,7 +28,7 @@ const convertExecArgv = async (execArgv) => { | ||
} | ||
else { | ||
const argName = arg.split('=')[0]; | ||
- const port = await (await Promise.resolve().then(() => require('get-port'))).default(); | ||
+ const port = await getFreePort(); | ||
convertedArgs.push(`${argName}=${port}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.