Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* Returns cleanup function
*/
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));
});
* Takes care of bootstrapping the application
* 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));
});
export function setForceExitTimeout(ms: number): void {
exitHook.forceExitTimeout(ms);
}