Skip to content

Commit 078b044

Browse files
Merge branch 'fix/perf_run_microservices' of https://github.com/Geode-solutions/OpenGeodeWeb-Front into fix/perf_run_microservices
2 parents 8aa8ef7 + 7ed999f commit 078b044

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

app/utils/local/microservices.js

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ function getAvailablePort() {
2727
}
2828

2929
function resolveCommand(execPath, execName) {
30-
const command = commandExistsSync(execName)
31-
? execName
32-
: executablePath(execPath, execName);
30+
const command = commandExistsSync(execName) ? execName : executablePath(execPath, execName);
3331
return command;
3432
}
3533

@@ -54,10 +52,7 @@ async function runScript(
5452
});
5553

5654
const controller = new AbortController();
57-
const timer = setTimeout(
58-
() => controller.abort(),
59-
timeoutSeconds * MILLISECONDS_PER_SECOND,
60-
);
55+
const timer = setTimeout(() => controller.abort(), timeoutSeconds * MILLISECONDS_PER_SECOND);
6156
if (typeof timer.unref === "function") timer.unref();
6257

6358
try {
@@ -82,11 +77,16 @@ async function runBack(execName, execPath, args = {}) {
8277
}
8378
const port = await getAvailablePort();
8479
const backArgs = [
85-
"--port", String(port),
86-
"--data_folder_path", projectFolderPath,
87-
"--upload_folder_path", uploadFolderPath,
88-
"--allowed_origin", "http://localhost:*",
89-
"--timeout", "0",
80+
"--port",
81+
String(port),
82+
"--data_folder_path",
83+
projectFolderPath,
84+
"--upload_folder_path",
85+
uploadFolderPath,
86+
"--allowed_origin",
87+
"http://localhost:*",
88+
"--timeout",
89+
"0",
9090
];
9191
if (process.env.NODE_ENV === "development" || !process.env.NODE_ENV) {
9292
backArgs.push("--debug");
@@ -103,9 +103,12 @@ async function runViewer(execName, execPath, args = {}) {
103103
}
104104
const port = await getAvailablePort();
105105
const viewerArgs = [
106-
"--port", String(port),
107-
"--data_folder_path", projectFolderPath,
108-
"--timeout", "0",
106+
"--port",
107+
String(port),
108+
"--data_folder_path",
109+
projectFolderPath,
110+
"--timeout",
111+
"0",
109112
];
110113
console.log("runViewer", execPath, execName, viewerArgs);
111114
await runScript(execPath, execName, viewerArgs, "Starting factory");

0 commit comments

Comments
 (0)