Browse Source

Always get quotes (with fallback to historical data)

pull/2875/head
Thomas Kaul 2 years ago
parent
commit
74ccb4ec52
  1. 4
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
  2. 4
      apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts

4
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts

@ -33,6 +33,10 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface {
symbol = `${DEFAULT_CURRENCY}${symbol}`;
}
if (symbol.includes(`${DEFAULT_CURRENCY}ZAC`)) {
symbol = `${DEFAULT_CURRENCY}ZAc`;
}
return symbol.replace('=X', '');
}

4
apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts

@ -136,9 +136,6 @@ export class ExchangeRateDataService {
getYesterday()
);
if (Object.keys(result).length !== this.currencyPairs.length) {
// Load currencies directly from data provider as a fallback
// if historical data is not fully available
const quotes = await this.dataProviderService.getQuotes({
items: this.currencyPairs.map(({ dataSource, symbol }) => {
return { dataSource, symbol };
@ -155,7 +152,6 @@ export class ExchangeRateDataService {
};
}
}
}
const resultExtended = result;

Loading…
Cancel
Save