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/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 [MESSAGE, SECDFNTN, SIGTERM, GET, READY, SET, SHIFT, POP, DELKEY, CALL]
13
- = [
14
- 'message', 100, 'SIGTERM', 'GET', 'READY', 'SET', 'SHIFT', 'POP',
15
- 'DELKEY', 'CALL',
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
- // https://www.knowledgehut.com/blog/web-development/node-js-process-exit
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
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1999.1.88",
4
+ "version": "1999.1.89",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "1999.1.88",
4
+ "version": "1999.1.89",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",