@meyverick/omnicode 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -21,15 +21,17 @@ async function initTool(name, args, logPath) {
|
|
|
21
21
|
try {
|
|
22
22
|
log = openSync(logPath, "w");
|
|
23
23
|
const child = spawn(name, args, { stdio: ["ignore", log, log] });
|
|
24
|
+
let timer;
|
|
24
25
|
const result = await Promise.race([
|
|
25
26
|
new Promise((resolve) => {
|
|
26
27
|
child.on("close", resolve);
|
|
27
28
|
child.on("error", () => resolve(null));
|
|
28
29
|
}),
|
|
29
30
|
new Promise((resolve) => {
|
|
30
|
-
setTimeout(() => { child.kill(); resolve(null); }, 30000);
|
|
31
|
+
timer = setTimeout(() => { child.kill(); resolve(null); }, 30000);
|
|
31
32
|
}),
|
|
32
33
|
]);
|
|
34
|
+
clearTimeout(timer);
|
|
33
35
|
if (result === null) {
|
|
34
36
|
console.log(`[omnicode] WARNING: ${name} init timed out; continuing. Log: ${logPath}`);
|
|
35
37
|
} else if (result === 0) {
|