Browse Source

Merge branch 'main' into feature/add-pagination-to-platform-and-tag-management-of-admin-control-panel

pull/7126/head
Thomas Kaul 3 weeks ago
committed by GitHub
parent
commit
bf7843074e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 6
      apps/api/src/services/data-provider/data-provider.service.ts
  3. 1
      apps/api/src/services/data-provider/interfaces/data-provider.interface.ts
  4. 45
      apps/api/src/services/data-provider/manual/manual.service.ts

4
CHANGELOG.md

@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added pagination to the platform management of the admin control panel - Added pagination to the platform management of the admin control panel
- Added pagination to the tag management of the admin control panel - Added pagination to the tag management of the admin control panel
### Fixed
- Fixed an issue with hourly market data updates not refreshing prices for asset profiles with `MANUAL` data source
## 3.15.1 - 2026-06-23 ## 3.15.1 - 2026-06-23
### Changed ### Changed

6
apps/api/src/services/data-provider/data-provider.service.ts

@ -662,7 +662,11 @@ export class DataProviderService implements OnModuleInit {
); );
const promise = Promise.resolve( const promise = Promise.resolve(
dataProvider.getQuotes({ requestTimeout, symbols: symbolsChunk }) dataProvider.getQuotes({
requestTimeout,
useCache,
symbols: symbolsChunk
})
); );
promises.push( promises.push(

1
apps/api/src/services/data-provider/interfaces/data-provider.interface.ts

@ -75,6 +75,7 @@ export interface GetHistoricalParams {
export interface GetQuotesParams { export interface GetQuotesParams {
requestTimeout?: number; requestTimeout?: number;
symbols: string[]; symbols: string[];
useCache?: boolean;
} }
export interface GetSearchParams { export interface GetSearchParams {

45
apps/api/src/services/data-provider/manual/manual.service.ts

@ -136,7 +136,8 @@ export class ManualService implements DataProviderInterface {
} }
public async getQuotes({ public async getQuotes({
symbols symbols,
useCache = true
}: GetQuotesParams): Promise<{ [symbol: string]: DataProviderResponse }> { }: GetQuotesParams): Promise<{ [symbol: string]: DataProviderResponse }> {
const response: { [symbol: string]: DataProviderResponse } = {}; const response: { [symbol: string]: DataProviderResponse } = {};
@ -164,32 +165,32 @@ export class ManualService implements DataProviderInterface {
} }
}); });
const symbolProfilesWithScraperConfigurationAndInstantMode = const symbolProfilesToScrape = symbolProfiles.filter(
symbolProfiles.filter(({ scraperConfiguration }) => { ({ scraperConfiguration }) => {
return ( return (
scraperConfiguration?.mode === 'instant' && (scraperConfiguration?.mode === 'instant' || !useCache) &&
scraperConfiguration?.selector && scraperConfiguration?.selector &&
scraperConfiguration?.url scraperConfiguration?.url
); );
}); }
);
const scraperResultPromises =
symbolProfilesWithScraperConfigurationAndInstantMode.map( const scraperResultPromises = symbolProfilesToScrape.map(
async ({ scraperConfiguration, symbol }) => { async ({ scraperConfiguration, symbol }) => {
try { try {
const marketPrice = await this.scrape({ const marketPrice = await this.scrape({
scraperConfiguration, scraperConfiguration,
symbol symbol
}); });
return { marketPrice, symbol }; return { marketPrice, symbol };
} catch (error) { } catch (error) {
this.logger.error( this.logger.error(
`Could not get quote for ${symbol} (${this.getName()}): [${error.name}] ${error.message}` `Could not get quote for ${symbol} (${this.getName()}): [${error.name}] ${error.message}`
); );
return { symbol, marketPrice: undefined }; return { symbol, marketPrice: undefined };
}
} }
); }
);
// Wait for all scraping requests to complete concurrently // Wait for all scraping requests to complete concurrently
const scraperResults = await Promise.all(scraperResultPromises); const scraperResults = await Promise.all(scraperResultPromises);

Loading…
Cancel
Save