mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
🐛 Fix issue that DB init errors did not get caught #1269
This commit is contained in:
@@ -121,10 +121,16 @@ export class Start extends Command {
|
|||||||
const { flags } = this.parse(Start);
|
const { flags } = this.parse(Start);
|
||||||
|
|
||||||
// Wrap that the process does not close but we can still use async
|
// Wrap that the process does not close but we can still use async
|
||||||
(async () => {
|
await (async () => {
|
||||||
try {
|
try {
|
||||||
// Start directly with the init of the database to improve startup time
|
// Start directly with the init of the database to improve startup time
|
||||||
const startDbInitPromise = Db.init();
|
const startDbInitPromise = Db.init().catch(error => {
|
||||||
|
console.error(`There was an error initializing DB: ${error.message}`);
|
||||||
|
|
||||||
|
processExistCode = 1;
|
||||||
|
// @ts-ignore
|
||||||
|
process.emit('SIGINT');
|
||||||
|
});
|
||||||
|
|
||||||
// Make sure the settings exist
|
// Make sure the settings exist
|
||||||
const userSettings = await UserSettings.prepareUserSettings();
|
const userSettings = await UserSettings.prepareUserSettings();
|
||||||
|
|||||||
Reference in New Issue
Block a user