mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(core): Validate shutdown handlers on startup (#8260)
This commit is contained in:
@@ -9,7 +9,7 @@ import { Logger } from '@/Logger';
|
||||
import config from '@/config';
|
||||
import * as Db from '@/Db';
|
||||
import * as CrashJournal from '@/CrashJournal';
|
||||
import { LICENSE_FEATURES, inTest } from '@/constants';
|
||||
import { LICENSE_FEATURES, inDevelopment, inTest } from '@/constants';
|
||||
import { initErrorHandling } from '@/ErrorReporting';
|
||||
import { ExternalHooks } from '@/ExternalHooks';
|
||||
import { NodeTypes } from '@/NodeTypes';
|
||||
@@ -63,6 +63,12 @@ export abstract class BaseCommand extends Command {
|
||||
this.exitWithCrash('There was an error initializing DB', error),
|
||||
);
|
||||
|
||||
// This needs to happen after DB.init() or otherwise DB Connection is not
|
||||
// available via the dependency Container that services depend on.
|
||||
if (inDevelopment || inTest) {
|
||||
this.shutdownService.validate();
|
||||
}
|
||||
|
||||
await this.server?.init();
|
||||
|
||||
await Db.migrate().catch(async (error: Error) =>
|
||||
|
||||
Reference in New Issue
Block a user