@jsenv/utils
Advanced tools
Comparing version 1.4.2 to 1.4.4
@@ -69,15 +69,3 @@ import cluster from "node:cluster" | ||
}) | ||
const exitEventCallback = (worker, code, signal) => { | ||
// https://nodejs.org/dist/latest-v16.x/docs/api/cluster.html#workerexitedafterdisconnect | ||
if (worker.exitedAfterDisconnect) { | ||
logger.debug( | ||
`worker ${worker.process.pid} died with code: ${code}, and signal: ${signal}`, | ||
) | ||
logger.debug(`starting a new worker`) | ||
startWorker() | ||
} | ||
} | ||
cluster.on("exit", exitEventCallback) | ||
const killWorkers = () => { | ||
@@ -113,5 +101,19 @@ Object.keys(cluster.workers).forEach((workerId) => { | ||
}, | ||
keepProcessAlive: false, | ||
}) | ||
}) | ||
const exitEventCallback = (worker, code, signal) => { | ||
// https://nodejs.org/dist/latest-v16.x/docs/api/cluster.html#workerexitedafterdisconnect | ||
if (worker.exitedAfterDisconnect) { | ||
logger.debug( | ||
`worker ${worker.process.pid} died with code: ${code}, and signal: ${signal}`, | ||
) | ||
logger.debug(`starting a new worker`) | ||
startWorker() | ||
} | ||
} | ||
cluster.on("exit", exitEventCallback) | ||
const stop = () => { | ||
@@ -118,0 +120,0 @@ unregisters.forEach((unregister) => { |
@@ -417,3 +417,6 @@ import { getTypePropertyNode } from "./js_ast.js" | ||
callee.object.type === "Identifier" && | ||
callee.object.name === "_context" && | ||
// because of minification we can't assume _context. | ||
// so anything matching "*.import()" | ||
// will be assumed to be the equivalent to "import()" | ||
// callee.object.name === "_context" && | ||
callee.property.type === "Identifier" && | ||
@@ -420,0 +423,0 @@ callee.property.name === "import" |
@@ -6,4 +6,5 @@ export const msAsDuration = (ms) => { | ||
// (this function is meant to display a duration to a human) | ||
// so in this case we'll return "less than 1 millisecond" | ||
return "less than 1 millisecond" | ||
// so in this case we'll return "0 second" which means "less than 1 millisecond" | ||
// (I prefer "0 second" to be consistent with other logs wich will likely measure in "second") | ||
return "0 second" | ||
} | ||
@@ -10,0 +11,0 @@ const { primary, remaining } = parseMs(ms) |
{ | ||
"name": "@jsenv/utils", | ||
"version": "1.4.2", | ||
"version": "1.4.4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
199289
5901