refactor: startup

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 57135761ca
commit c54b6b9c7e

@ -6,17 +6,18 @@ const winston = require('winston');
const start = module.exports; const start = module.exports;
start.start = async function () { start.start = async function () {
const db = require('./database');
printStartupInfo(); printStartupInfo();
addProcessHandlers(); addProcessHandlers();
try { try {
const db = require('./database');
await db.init(); await db.init();
await db.checkCompatibility();
const meta = require('./meta'); const meta = require('./meta');
await db.checkCompatibility();
await meta.configs.init(); await meta.configs.init();
if (nconf.get('runJobs')) { if (nconf.get('runJobs')) {
await runUpgrades(); await runUpgrades();
} }

Loading…
Cancel
Save