Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var debug = require("debug")("blot:build");
var helper = require("helper");
var clfdate = helper.clfdate;
var workers = [];
var jobs = {};
debug("Master", process.pid, "is running");
exitHook(function() {
debug("Shutting down master:", process.pid);
workers.forEach(function(item) {
item.worker.kill();
});
});
exitHook.uncaughtExceptionHandler(function(err) {
console.error(err);
workers.forEach(function(item) {
item.worker.kill();
});
});
function messageHandler(id) {
return function(message) {
debug("Handling message", id);
var err = null;
// Ressurrect error from string. You can remove
// this when we can pass something with type Error
// between child processes in future.
if (message.err) {
try {