mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
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
@@ -3,9 +3,10 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import type { FindOptionsWhere } from 'typeorm';
|
||||
import { Credentials } from 'n8n-core';
|
||||
import * as Db from '@/Db';
|
||||
import type { ICredentialsDb, ICredentialsDecryptedDb } from '@/Interfaces';
|
||||
import { BaseCommand } from '../BaseCommand';
|
||||
import { CredentialsRepository } from '@db/repositories/credentials.repository';
|
||||
import Container from 'typedi';
|
||||
|
||||
export class ExportCredentialsCommand extends BaseCommand {
|
||||
static description = 'Export credentials';
|
||||
@@ -110,7 +111,8 @@ export class ExportCredentialsCommand extends BaseCommand {
|
||||
findQuery.id = flags.id;
|
||||
}
|
||||
|
||||
const credentials: ICredentialsDb[] = await Db.collections.Credentials.findBy(findQuery);
|
||||
const credentials: ICredentialsDb[] =
|
||||
await Container.get(CredentialsRepository).findBy(findQuery);
|
||||
|
||||
if (flags.decrypted) {
|
||||
for (let i = 0; i < credentials.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user