mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Use an IoC container to manage singleton classes [Part-2] (no-changelog) (#5690)
* use typedi for UserManagementMailer * use typedi for SamlService * fix typos * use typedi for Queue * use typedi for License * convert some more code to use typedi
This commit is contained in:
committed by
GitHub
parent
c07f838ce6
commit
9bd7529193
@@ -7,7 +7,7 @@ import { LoggerProxy } from 'n8n-workflow';
|
||||
import config from '@/config';
|
||||
import type { IExecutionTrackProperties } from '@/Interfaces';
|
||||
import { getLogger } from '@/Logger';
|
||||
import { getLicense } from '@/License';
|
||||
import { License } from '@/License';
|
||||
import { LicenseService } from '@/license/License.service';
|
||||
import { N8N_VERSION } from '@/constants';
|
||||
import { Service } from 'typedi';
|
||||
@@ -39,7 +39,7 @@ export class Telemetry {
|
||||
|
||||
private executionCountsBuffer: IExecutionsBuffer = {};
|
||||
|
||||
constructor(private postHog: PostHogClient) {}
|
||||
constructor(private postHog: PostHogClient, private license: License) {}
|
||||
|
||||
setInstanceId(instanceId: string) {
|
||||
this.instanceId = instanceId;
|
||||
@@ -97,8 +97,8 @@ export class Telemetry {
|
||||
|
||||
// License info
|
||||
const pulsePacket = {
|
||||
plan_name_current: getLicense().getPlanName(),
|
||||
quota: getLicense().getTriggerLimit(),
|
||||
plan_name_current: this.license.getPlanName(),
|
||||
quota: this.license.getTriggerLimit(),
|
||||
usage: await LicenseService.getActiveTriggerCount(),
|
||||
};
|
||||
allPromises.push(this.track('pulse', pulsePacket));
|
||||
|
||||
Reference in New Issue
Block a user