Skip to content

Commit 7ed999f

Browse files
Apply prepare changes
1 parent 36ab4fc commit 7ed999f

2 files changed

Lines changed: 20 additions & 17 deletions

File tree

app/utils/local/microservices.js

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

2727
function resolveCommand(execPath, execName) {
28-
const command = commandExistsSync(execName)
29-
? execName
30-
: executablePath(execPath, execName);
28+
const command = commandExistsSync(execName) ? execName : executablePath(execPath, execName);
3129
return command;
3230
}
3331

@@ -52,10 +50,7 @@ async function runScript(
5250
});
5351

5452
const controller = new AbortController();
55-
const timer = setTimeout(
56-
() => controller.abort(),
57-
timeoutSeconds * MILLISECONDS_PER_SECOND,
58-
);
53+
const timer = setTimeout(() => controller.abort(), timeoutSeconds * MILLISECONDS_PER_SECOND);
5954
if (typeof timer.unref === "function") timer.unref();
6055

6156
try {
@@ -80,11 +75,16 @@ async function runBack(execName, execPath, args = {}) {
8075
}
8176
const port = await getAvailablePort();
8277
const backArgs = [
83-
"--port", String(port),
84-
"--data_folder_path", projectFolderPath,
85-
"--upload_folder_path", uploadFolderPath,
86-
"--allowed_origin", "http://localhost:*",
87-
"--timeout", "0",
78+
"--port",
79+
String(port),
80+
"--data_folder_path",
81+
projectFolderPath,
82+
"--upload_folder_path",
83+
uploadFolderPath,
84+
"--allowed_origin",
85+
"http://localhost:*",
86+
"--timeout",
87+
"0",
8888
];
8989
if (process.env.NODE_ENV === "development" || !process.env.NODE_ENV) {
9090
backArgs.push("--debug");
@@ -101,9 +101,12 @@ async function runViewer(execName, execPath, args = {}) {
101101
}
102102
const port = await getAvailablePort();
103103
const viewerArgs = [
104-
"--port", String(port),
105-
"--data_folder_path", projectFolderPath,
106-
"--timeout", "0",
104+
"--port",
105+
String(port),
106+
"--data_folder_path",
107+
projectFolderPath,
108+
"--timeout",
109+
"0",
107110
];
108111
console.log("runViewer", execPath, execName, viewerArgs);
109112
await runScript(execPath, execName, viewerArgs, "Starting factory");

app/utils/local/scripts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function waitForReady(child, expectedResponse, signal) {
6161
reject(
6262
new Error(
6363
`[${child.name}] exited with code ${code} before becoming ready.` +
64-
(recentOutput ? `\nRecent output:\n${recentOutput}` : ""),
64+
(recentOutput ? `\nRecent output:\n${recentOutput}` : ""),
6565
),
6666
);
6767
};
@@ -76,7 +76,7 @@ function waitForReady(child, expectedResponse, signal) {
7676
child.once("error", onError);
7777
child.once("close", onClose);
7878
if (signal) signal.addEventListener("abort", onAbort, { once: true });
79-
})
79+
});
8080
}
8181

8282
async function waitNuxt(nuxtProcess) {

0 commit comments

Comments
 (0)