Remove performance logs (#6709)
We have found the root cause of the issue: - when using a datasource (including the cached ones), we are fetching ObjectMetadataCollection from cache (700kB). Datasource usage is happening any time we are using twentyORM, which is everywhere in the jobs and in some resolvers (including the GetCurrentUser one). This is leading to a high load on redis and leading to the performance issues we are seeing. - we actually don't need to fetch this objectMetadataCollection while using a cached datasource, only when we instantiate a new one
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import { Injectable, Type } from '@nestjs/common';
|
||||
|
||||
import { ObjectLiteral } from 'typeorm';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
import { WorkspaceDatasourceFactory } from 'src/engine/twenty-orm/factories/workspace-datasource.factory';
|
||||
import { WorkspaceRepository } from 'src/engine/twenty-orm/repository/workspace.repository';
|
||||
@ -37,16 +36,11 @@ export class TwentyORMGlobalManager {
|
||||
);
|
||||
}
|
||||
|
||||
const logId = v4();
|
||||
|
||||
console.time(`createDataSource in orm ${logId}`);
|
||||
const workspaceDataSource = await this.workspaceDataSourceFactory.create(
|
||||
workspaceId,
|
||||
null,
|
||||
);
|
||||
|
||||
console.timeEnd(`createDataSource in orm ${logId}`);
|
||||
|
||||
const repository = workspaceDataSource.getRepository<T>(objectMetadataName);
|
||||
|
||||
return repository;
|
||||
|
||||
Reference in New Issue
Block a user