Browse Source

Restrict historical market data gathering to active asset profiles

pull/4483/head
Thomas Kaul 4 weeks ago
parent
commit
fa5a234194
  1. 8
      apps/api/src/services/queues/data-gathering/data-gathering.service.ts
  2. 3
      apps/api/src/services/symbol-profile/symbol-profile.service.ts

8
apps/api/src/services/queues/data-gathering/data-gathering.service.ts

@ -300,7 +300,10 @@ export class DataGatheringService {
AssetProfileIdentifier[] AssetProfileIdentifier[]
> { > {
const symbolProfiles = await this.prismaService.symbolProfile.findMany({ const symbolProfiles = await this.prismaService.symbolProfile.findMany({
orderBy: [{ symbol: 'asc' }] orderBy: [{ symbol: 'asc' }],
where: {
isActive: true
}
}); });
return symbolProfiles return symbolProfiles
@ -436,6 +439,9 @@ export class DataGatheringService {
}, },
scraperConfiguration: true, scraperConfiguration: true,
symbol: true symbol: true
},
where: {
isActive: true
} }
}) })
) )

3
apps/api/src/services/symbol-profile/symbol-profile.service.ts

@ -106,6 +106,7 @@ export class SymbolProfileService {
}, },
orderBy: [{ symbol: 'asc' }], orderBy: [{ symbol: 'asc' }],
where: { where: {
isActive: true,
Order: withUserSubscription Order: withUserSubscription
? { ? {
some: { some: {
@ -133,6 +134,7 @@ export class SymbolProfileService {
currency, currency,
dataSource, dataSource,
holdings, holdings,
isActive,
name, name,
scraperConfiguration, scraperConfiguration,
sectors, sectors,
@ -149,6 +151,7 @@ export class SymbolProfileService {
countries, countries,
currency, currency,
holdings, holdings,
isActive,
name, name,
scraperConfiguration, scraperConfiguration,
sectors, sectors,

Loading…
Cancel
Save