mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
🐛 Fix issue that DB init errors did not get caught #1269
This commit is contained in:
parent
75cca869b4
commit
ecdcc0b522
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue