ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671)
This also gets rid of `Db.collection`, which was another source of circular dependencies.
This commit is contained in:
committed by
GitHub
parent
37dd658dc5
commit
000e76e3b4
@@ -6,13 +6,13 @@ import {
|
||||
MessageEventBusDestinationTypeNames,
|
||||
MessageEventBusDestinationOptions,
|
||||
} from 'n8n-workflow';
|
||||
import * as Db from '@/Db';
|
||||
import { Logger } from '@/Logger';
|
||||
import type { AbstractEventMessage } from '../EventMessageClasses/AbstractEventMessage';
|
||||
import type { EventMessageTypes } from '../EventMessageClasses';
|
||||
import type { EventMessageConfirmSource } from '../EventMessageClasses/EventMessageConfirm';
|
||||
import { MessageEventBus } from '../MessageEventBus/MessageEventBus';
|
||||
import type { MessageWithCallback } from '../MessageEventBus/MessageEventBus';
|
||||
import { EventDestinationsRepository } from '@db/repositories/eventDestinations.repository';
|
||||
|
||||
export abstract class MessageEventBusDestination implements MessageEventBusDestinationOptions {
|
||||
// Since you can't have static abstract functions - this just serves as a reminder that you need to implement these. Please.
|
||||
@@ -96,7 +96,7 @@ export abstract class MessageEventBusDestination implements MessageEventBusDesti
|
||||
id: this.getId(),
|
||||
destination: this.serialize(),
|
||||
};
|
||||
const dbResult: InsertResult = await Db.collections.EventDestinations.upsert(data, {
|
||||
const dbResult: InsertResult = await Container.get(EventDestinationsRepository).upsert(data, {
|
||||
skipUpdateIfNoValuesChanged: true,
|
||||
conflictPaths: ['id'],
|
||||
});
|
||||
@@ -108,7 +108,7 @@ export abstract class MessageEventBusDestination implements MessageEventBusDesti
|
||||
}
|
||||
|
||||
static async deleteFromDb(id: string): Promise<DeleteResult> {
|
||||
const dbResult = await Db.collections.EventDestinations.delete({ id });
|
||||
const dbResult = await Container.get(EventDestinationsRepository).delete({ id });
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MessageEventBusDestinationTypeNames } from 'n8n-workflow';
|
||||
import type { EventDestinations } from '@/databases/entities/EventDestinations';
|
||||
import type { EventDestinations } from '@db/entities/EventDestinations';
|
||||
import type { MessageEventBus } from '../MessageEventBus/MessageEventBus';
|
||||
import type { MessageEventBusDestination } from './MessageEventBusDestination.ee';
|
||||
import { MessageEventBusDestinationSentry } from './MessageEventBusDestinationSentry.ee';
|
||||
|
||||
Reference in New Issue
Block a user