Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
script : pathToAppBundle,
exec_interpreter : pathToNode,
});
break;
default:
console.log('unknown process type:', p.type);
// case 'mongod':
}
}
console.log('started all process');
} catch (err) {
console.log(err.stack);
} finally {
await asPromise(pm2.disconnect());
console.log('disconnected from pm2');
}
};
pm2.start(ecosystem, function(err, proc) {
cb(err, 'localhost:3000');
console.log(proc);
pm2.disconnect(); // Disconnects from PM2
if (err) console.log(err);
});
});
});
// DISCONNECT
pm2.disconnect();
}));
}
// ERRORED LOGS INSERT
Logs.insert({
process: { name: self.bundleId },
type: LOG_TYPE_MAPPER.ERRORED,
data: start_error.msg
});
// IF STARTED ERROR THEN DISCONNECT
pm2.disconnect();
}));
}));
// CD BUNDLES DIR
cd(BUNDLE_DIR);
// REMOVE APPLICATON DIR AND BUNDLE FILE
rm('-rf', [
// DIR
doc.bundleId,
// TAR.GZ
`${doc.bundleId}.tar.gz`
]);
// DISCONNECT
pm2.disconnect();
});
});
function stopIfEx(ex) {
if (ex) {
Log_1.error(ex.message || ex);
PM2.disconnect();
process.exit(1);
}
}
exports.stopIfEx = stopIfEx;
pm2.start(processOptions, error => {
console.log(`Ethstats daemon START ${(error) ? chalk.red(`[FAILED] ${error.message}`) : chalk.green('[OK]')}`);
pm2.disconnect();
});
}
export function stopIfEx(ex: any) {
if (ex) {
error(ex.message || ex);
PM2.disconnect();
process.exit(1);
}
}
Runner.prototype.disconnect = function (next) {
pm2.disconnect(next);
};
const disconnect = function() {
pm2.disconnect()
}