update cleaning job to progressively delete metadata (#14596)
Workspace cleaning jobs slow down the db each hours when running. We suspect the object metadata deleting query with all cascade/depending entities (field, index, ..) to be the cause.
This commit is contained in:
-7
@@ -29,7 +29,6 @@ describe('WorkspaceManagerService', () => {
|
||||
let objectMetadataService: ObjectMetadataService;
|
||||
let workspaceMigrationRepository: Repository<WorkspaceMigrationEntity>;
|
||||
let dataSourceRepository: Repository<DataSourceEntity>;
|
||||
let workspaceFieldMetadataRepository: Repository<FieldMetadataEntity>;
|
||||
let workspaceDataSourceService: WorkspaceDataSourceService;
|
||||
let roleTargetsRepository: Repository<RoleTargetsEntity>;
|
||||
let roleRepository: Repository<RoleEntity>;
|
||||
@@ -155,9 +154,6 @@ describe('WorkspaceManagerService', () => {
|
||||
dataSourceRepository = module.get<Repository<DataSourceEntity>>(
|
||||
getRepositoryToken(DataSourceEntity),
|
||||
);
|
||||
workspaceFieldMetadataRepository = module.get<
|
||||
Repository<FieldMetadataEntity>
|
||||
>(getRepositoryToken(FieldMetadataEntity));
|
||||
workspaceDataSourceService = module.get<WorkspaceDataSourceService>(
|
||||
WorkspaceDataSourceService,
|
||||
);
|
||||
@@ -177,9 +173,6 @@ describe('WorkspaceManagerService', () => {
|
||||
it('should delete all the workspace metadata tables and workspace schema', async () => {
|
||||
await service.delete('workspace-id');
|
||||
expect(objectMetadataService.deleteObjectsMetadata).toHaveBeenCalled();
|
||||
expect(workspaceFieldMetadataRepository.delete).toHaveBeenCalledWith({
|
||||
workspaceId: 'workspace-id',
|
||||
});
|
||||
expect(workspaceMigrationRepository.delete).toHaveBeenCalledWith({
|
||||
workspaceId: 'workspace-id',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user