feat(core): Add instanceId to n8n.ready hook (no-changelog) (#6007)

* add instanceId to n8n.ready hook

* Set instanceId during configuration method
This commit is contained in:
Ricardo Espinoza 2023-04-24 09:12:00 -04:00 committed by GitHub
parent c7b1920943
commit 13ef3c1d20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -55,6 +55,8 @@ export abstract class AbstractServer {
protected endpointWebhookWaiting: string;
protected instanceId = '';
abstract configure(): Promise<void>;
constructor() {

View file

@ -444,13 +444,15 @@ class Server extends AbstractServer {
async configure(): Promise<void> {
configureMetrics(this.app);
this.instanceId = await UserSettings.getInstanceId();
this.frontendSettings.isNpmAvailable = await exec('npm --version')
.then(() => true)
.catch(() => false);
this.frontendSettings.versionCli = N8N_VERSION;
this.frontendSettings.instanceId = await UserSettings.getInstanceId();
this.frontendSettings.instanceId = this.instanceId;
await this.externalHooks.run('frontend.settings', [this.frontendSettings]);