Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logger.log(
'warn',
`--> Failed to report unexpected closure to runnerty.io. ${err}`
);
}
}
process.on('uncaughtException', err => {
if (err.code === 'EADDRINUSE') {
logger.log('error', `Unable to start server: ${err.message}`);
} else {
logger.log('error', err.message);
}
});
exitHook.unhandledRejectionHandler(err => {
logger.log('error', err);
});
exitHook(callback => {
preExit().then(_ => {
callback();
});
});
*/
async function boot(constants: typeof constantsType): Promise {
const manager = new AppManager(
appConfig,
logger,
versionBuild,
genesisBlock,
constants,
allExceptionCreator
);
await manager.boot();
return manager;
}
exitHook.forceExitTimeout(15000);
exitHook.unhandledRejectionHandler((err) => {
logger.fatal('Unhandled Promise rejection', err);
});
boot(constantsType)
.catch((err) => {
logger.fatal('Error when instantiating');
logger.fatal(err);
process.exit(1);
return Promise.reject(err);
})
.then((manager) => {
exitHook((cb) => promiseToCB(manager.tearDown(), cb));
});
* Returns cleanup function
*/
async function boot(): Promise {
const manager = new AppManager(
appConfig,
logger,
callingPackageJSON.version,
genesisBlock,
modules
);
await manager.boot();
return manager;
}
exitHook.forceExitTimeout(15000);
exitHook.unhandledRejectionHandler((err) => {
logger.fatal('Unhandled Promise rejection', err);
});
boot()
.catch((err) => {
logger.fatal('Error when instantiating');
logger.fatal(err);
return Promise.reject(err);
})
.then((manager) => {
exitHook((cb) => promiseToCB(manager.tearDown(), cb));
});