poku 4.3.0 → 4.3.1-canary.d3ede923
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/lib/configs/poku.js
CHANGED
|
@@ -28,7 +28,6 @@ const backgroundProcess = (runtime, args, file, options) => new Promise((resolve
|
|
|
28
28
|
const PID = service.pid;
|
|
29
29
|
service.stdout.setEncoding('utf8');
|
|
30
30
|
service.stderr.setEncoding('utf8');
|
|
31
|
-
let portBackup;
|
|
32
31
|
const end = (port) => new Promise((resolve) => {
|
|
33
32
|
try {
|
|
34
33
|
runningProcesses.delete(PID);
|
|
@@ -58,7 +57,7 @@ const backgroundProcess = (runtime, args, file, options) => new Promise((resolve
|
|
|
58
57
|
return;
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
|
-
runningProcesses.set(PID,
|
|
60
|
+
runningProcesses.set(PID, end);
|
|
62
61
|
service.stdout.on('data', (data) => {
|
|
63
62
|
if (!isResolved && typeof options?.startAfter !== 'number') {
|
|
64
63
|
const stringData = JSON.stringify(String(data));
|
|
@@ -86,7 +85,7 @@ const backgroundProcess = (runtime, args, file, options) => new Promise((resolve
|
|
|
86
85
|
options?.verbose && (0, write_js_1.log)(data);
|
|
87
86
|
});
|
|
88
87
|
service.on('error', (err) => {
|
|
89
|
-
end(
|
|
88
|
+
end();
|
|
90
89
|
reject(`Service failed to start: ${err}`);
|
|
91
90
|
});
|
|
92
91
|
service.on('close', (code) => {
|
|
@@ -95,7 +94,7 @@ const backgroundProcess = (runtime, args, file, options) => new Promise((resolve
|
|
|
95
94
|
});
|
|
96
95
|
const timeout = setTimeout(() => {
|
|
97
96
|
if (!isResolved) {
|
|
98
|
-
end(
|
|
97
|
+
end();
|
|
99
98
|
reject(`createService: Timeout\nFile: ${file}`);
|
|
100
99
|
}
|
|
101
100
|
}, options?.timeout || 60000);
|
|
@@ -138,6 +137,6 @@ const startScript = (script, options) => {
|
|
|
138
137
|
};
|
|
139
138
|
exports.startScript = startScript;
|
|
140
139
|
node_process_1.default.once('SIGINT', async () => {
|
|
141
|
-
for (const
|
|
142
|
-
await end(
|
|
140
|
+
for (const end of runningProcesses.values())
|
|
141
|
+
await end();
|
|
143
142
|
});
|