utilitas 1999.1.88 → 1999.1.89
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/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/callosum.mjs +8 -6
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/callosum.mjs
CHANGED
|
@@ -9,10 +9,12 @@ import cluster from 'cluster';
|
|
|
9
9
|
import color from './color.mjs';
|
|
10
10
|
import uoid from './uoid.mjs';
|
|
11
11
|
|
|
12
|
-
const [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const [
|
|
13
|
+
MESSAGE, SECDFNTN, SIGINT, SIGTERM, GET, READY, SET, SHIFT, POP, DELKEY,
|
|
14
|
+
CALL,
|
|
15
|
+
] = [
|
|
16
|
+
'message', 100, 'SIGINT', 'SIGTERM', 'GET', 'READY', 'SET', 'SHIFT',
|
|
17
|
+
'POP', 'DELKEY', 'CALL',
|
|
16
18
|
];
|
|
17
19
|
|
|
18
20
|
const { isPrimary, isWorker, worker, workers } = cluster;
|
|
@@ -121,6 +123,7 @@ const init = async (options) => {
|
|
|
121
123
|
|| (code !== 0 && `exited with error code: ${code}`)
|
|
122
124
|
|| 'exited'}.`, worker);
|
|
123
125
|
await runFunc(options?.onExit, [worker, code, signal]);
|
|
126
|
+
[SIGINT, SIGTERM].includes(signal) && process.exit(0);
|
|
124
127
|
}); // https://nodejs.org/api/cluster.html
|
|
125
128
|
cluster.on('online', async (worker) => {
|
|
126
129
|
await runFunc(options?.onOnline, [worker]);
|
|
@@ -148,8 +151,7 @@ const init = async (options) => {
|
|
|
148
151
|
}
|
|
149
152
|
}, 3, 10, 0, eventName, { silent: true });
|
|
150
153
|
} else {
|
|
151
|
-
|
|
152
|
-
process.on(SIGTERM, () => process.exit(12));
|
|
154
|
+
process.on(SIGTERM, () => process.exit(0));
|
|
153
155
|
report(READY, await runFunc(options?.initWorker, [cluster.worker]));
|
|
154
156
|
}
|
|
155
157
|
};
|
package/lib/manifest.mjs
CHANGED