Skip to content

Commit

Permalink
revert InternalHooks.init
Browse files Browse the repository at this point in the history
will revisit in another PR
  • Loading branch information
netroy committed Oct 23, 2023
1 parent 4ea8662 commit 6d40dc8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/cli/src/InternalHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ export class InternalHooks implements IInternalHooksClass {
);
}

async init() {
await this.telemetry.init();
}

async onServerStarted(
diagnosticInfo: IDiagnosticInfo,
earliestWorkflowCreatedAt?: Date,
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/WorkflowRunnerProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import { PermissionChecker } from '@/UserManagement/PermissionChecker';
import { License } from '@/License';
import { InternalHooks } from '@/InternalHooks';
import { PostHogClient } from '@/posthog';
import { Telemetry } from './telemetry';

if (process.env.NODEJS_PREFER_IPV4 === 'true') {
setDefaultResultOrder('ipv4first');
Expand Down Expand Up @@ -117,8 +116,8 @@ class WorkflowRunnerProcess {
const externalHooks = Container.get(ExternalHooks);
await externalHooks.init();

await Container.get(Telemetry).init();
await Container.get(PostHogClient).init();
await Container.get(InternalHooks).init();

const binaryDataConfig = config.getEnv('binaryDataManager');
await Container.get(BinaryDataService).init(binaryDataConfig);
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/BaseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import { ExternalHooks } from '@/ExternalHooks';
import { NodeTypes } from '@/NodeTypes';
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import type { IExternalHooksClass, N8nInstanceType } from '@/Interfaces';
import { InternalHooks } from '@/InternalHooks';
import { PostHogClient } from '@/posthog';
import { License } from '@/License';
import { ExternalSecretsManager } from '@/ExternalSecrets/ExternalSecretsManager.ee';
import { initExpressionEvaluator } from '@/ExpressionEvalator';
import { generateHostInstanceId } from '../databases/utils/generators';
import { WorkflowHistoryManager } from '@/workflows/workflowHistory/workflowHistoryManager.ee';
import { Telemetry } from '@/telemetry';

export abstract class BaseCommand extends Command {
protected logger = LoggerProxy.init(getLogger());
Expand Down Expand Up @@ -73,8 +73,8 @@ export abstract class BaseCommand extends Command {
);
}

await Container.get(Telemetry).init();
await Container.get(PostHogClient).init();
await Container.get(InternalHooks).init();
}

protected setInstanceType(instanceType: N8nInstanceType) {
Expand Down

0 comments on commit 6d40dc8

Please sign in to comment.