From fa5a23419465a15e4d16574deb2dc577bdb115ee Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 24 Mar 2025 21:53:52 +0100 Subject: [PATCH] Restrict historical market data gathering to active asset profiles --- .../queues/data-gathering/data-gathering.service.ts | 8 +++++++- .../src/services/symbol-profile/symbol-profile.service.ts | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/api/src/services/queues/data-gathering/data-gathering.service.ts b/apps/api/src/services/queues/data-gathering/data-gathering.service.ts index b3e7de0b3..778e432c8 100644 --- a/apps/api/src/services/queues/data-gathering/data-gathering.service.ts +++ b/apps/api/src/services/queues/data-gathering/data-gathering.service.ts @@ -300,7 +300,10 @@ export class DataGatheringService { AssetProfileIdentifier[] > { const symbolProfiles = await this.prismaService.symbolProfile.findMany({ - orderBy: [{ symbol: 'asc' }] + orderBy: [{ symbol: 'asc' }], + where: { + isActive: true + } }); return symbolProfiles @@ -436,6 +439,9 @@ export class DataGatheringService { }, scraperConfiguration: true, symbol: true + }, + where: { + isActive: true } }) ) diff --git a/apps/api/src/services/symbol-profile/symbol-profile.service.ts b/apps/api/src/services/symbol-profile/symbol-profile.service.ts index 0dae63311..98c17a617 100644 --- a/apps/api/src/services/symbol-profile/symbol-profile.service.ts +++ b/apps/api/src/services/symbol-profile/symbol-profile.service.ts @@ -106,6 +106,7 @@ export class SymbolProfileService { }, orderBy: [{ symbol: 'asc' }], where: { + isActive: true, Order: withUserSubscription ? { some: { @@ -133,6 +134,7 @@ export class SymbolProfileService { currency, dataSource, holdings, + isActive, name, scraperConfiguration, sectors, @@ -149,6 +151,7 @@ export class SymbolProfileService { countries, currency, holdings, + isActive, name, scraperConfiguration, sectors,