Skip to content
/ qp-n8n Public
forked from n8n-io/n8n

Commit

Permalink
feat(core): Add instanceId to n8n.ready hook (no-changelog) (n8n-io#6007
Browse files Browse the repository at this point in the history
)

* add instanceId to n8n.ready hook

* Set instanceId during configuration method
  • Loading branch information
RicardoE105 authored and sunilrr committed Apr 24, 2023
1 parent 92c06f8 commit 73ba4a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/cli/src/AbstractServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export abstract class AbstractServer {

protected endpointWebhookWaiting: string;

protected instanceId = '';

abstract configure(): Promise<void>;

constructor() {
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit 73ba4a5

Please sign in to comment.