Fix onboarding status performance issues (#6512)

Updated the onboardingStatus computation to improve performances

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
martmull
2024-08-04 00:33:33 +02:00
committed by GitHub
parent e01d3fd0be
commit 7cd5427589
40 changed files with 757 additions and 767 deletions

View File

@ -6,7 +6,7 @@ import { Command, CommandRunner, Option } from 'nest-commander';
import { Repository } from 'typeorm';
import { TypeORMService } from 'src/database/typeorm/typeorm.service';
import { BillingService } from 'src/engine/core-modules/billing/billing.service';
import { BillingSubscriptionService } from 'src/engine/core-modules/billing/services/billing-subscription.service';
import {
Workspace,
WorkspaceActivationStatus,
@ -32,7 +32,7 @@ export class SetWorkspaceActivationStatusCommand extends CommandRunner {
private readonly typeORMService: TypeORMService,
private readonly dataSourceService: DataSourceService,
private readonly workspaceCacheVersionService: WorkspaceCacheVersionService,
private readonly billingService: BillingService,
private readonly billingSubscriptionService: BillingSubscriptionService,
) {
super();
}
@ -56,7 +56,7 @@ export class SetWorkspaceActivationStatusCommand extends CommandRunner {
activeSubscriptionWorkspaceIds = [options.workspaceId];
} else {
activeSubscriptionWorkspaceIds =
await this.billingService.getActiveSubscriptionWorkspaceIds();
await this.billingSubscriptionService.getActiveSubscriptionWorkspaceIds();
}
if (!activeSubscriptionWorkspaceIds.length) {