Browse Source
Bugfix/hourly market data updates not refreshing prices for asset profiles with manual data source (#7122)
* Fix hourly market data updates not refreshing prices for MANUAL asset profiles
* Update changelog
pull/7126/head^2
Thomas Kaul
3 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
35 additions and
23 deletions
-
CHANGELOG.md
-
apps/api/src/services/data-provider/data-provider.service.ts
-
apps/api/src/services/data-provider/interfaces/data-provider.interface.ts
-
apps/api/src/services/data-provider/manual/manual.service.ts
|
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. |
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
|
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### 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 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
@ -662,7 +662,11 @@ export class DataProviderService implements OnModuleInit { |
|
|
|
); |
|
|
|
|
|
|
|
const promise = Promise.resolve( |
|
|
|
dataProvider.getQuotes({ requestTimeout, symbols: symbolsChunk }) |
|
|
|
dataProvider.getQuotes({ |
|
|
|
requestTimeout, |
|
|
|
useCache, |
|
|
|
symbols: symbolsChunk |
|
|
|
}) |
|
|
|
); |
|
|
|
|
|
|
|
promises.push( |
|
|
|
|
|
|
|
@ -75,6 +75,7 @@ export interface GetHistoricalParams { |
|
|
|
export interface GetQuotesParams { |
|
|
|
requestTimeout?: number; |
|
|
|
symbols: string[]; |
|
|
|
useCache?: boolean; |
|
|
|
} |
|
|
|
|
|
|
|
export interface GetSearchParams { |
|
|
|
|
|
|
|
@ -136,7 +136,8 @@ export class ManualService implements DataProviderInterface { |
|
|
|
} |
|
|
|
|
|
|
|
public async getQuotes({ |
|
|
|
symbols |
|
|
|
symbols, |
|
|
|
useCache = true |
|
|
|
}: GetQuotesParams): Promise<{ [symbol: string]: DataProviderResponse }> { |
|
|
|
const response: { [symbol: string]: DataProviderResponse } = {}; |
|
|
|
|
|
|
|
@ -164,17 +165,17 @@ export class ManualService implements DataProviderInterface { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const symbolProfilesWithScraperConfigurationAndInstantMode = |
|
|
|
symbolProfiles.filter(({ scraperConfiguration }) => { |
|
|
|
const symbolProfilesToScrape = symbolProfiles.filter( |
|
|
|
({ scraperConfiguration }) => { |
|
|
|
return ( |
|
|
|
scraperConfiguration?.mode === 'instant' && |
|
|
|
(scraperConfiguration?.mode === 'instant' || !useCache) && |
|
|
|
scraperConfiguration?.selector && |
|
|
|
scraperConfiguration?.url |
|
|
|
); |
|
|
|
}); |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
const scraperResultPromises = |
|
|
|
symbolProfilesWithScraperConfigurationAndInstantMode.map( |
|
|
|
const scraperResultPromises = symbolProfilesToScrape.map( |
|
|
|
async ({ scraperConfiguration, symbol }) => { |
|
|
|
try { |
|
|
|
const marketPrice = await this.scrape({ |
|
|
|
|