Anatoly Popov
1 week ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
18 additions and
4 deletions
-
apps/api/src/app/endpoints/data-providers/ghostfolio/ghostfolio.service.ts
-
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
-
apps/api/src/services/data-provider/data-provider.service.ts
-
apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
|
|
@ -294,9 +294,14 @@ export class GhostfolioService { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
const searchResults = await Promise.all(promises); |
|
|
|
const searchResults = await Promise.allSettled(promises); |
|
|
|
|
|
|
|
for (const { items } of searchResults) { |
|
|
|
for (const result of searchResults) { |
|
|
|
if (result.status === 'rejected') { |
|
|
|
Logger.warn(result.reason, 'GhostfolioService'); |
|
|
|
continue; |
|
|
|
} |
|
|
|
const { items } = result.value; |
|
|
|
if (items?.length > 0) { |
|
|
|
lookupItems = lookupItems.concat(items); |
|
|
|
} |
|
|
|
|
|
@ -102,6 +102,9 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { |
|
|
|
yahooSymbol = symbol; |
|
|
|
} else { |
|
|
|
const { quotes } = await this.yahooFinance.search(response.isin); |
|
|
|
if (quotes.length === 0) { |
|
|
|
return response; |
|
|
|
} |
|
|
|
yahooSymbol = quotes[0].symbol as string; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -650,9 +650,14 @@ export class DataProviderService implements OnModuleInit { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
const searchResults = await Promise.all(promises); |
|
|
|
const searchResults = await Promise.allSettled(promises); |
|
|
|
|
|
|
|
for (const { items } of searchResults) { |
|
|
|
for (const result of searchResults) { |
|
|
|
if (result.status === 'rejected') { |
|
|
|
Logger.warn(result.reason, 'DataProviderService'); |
|
|
|
continue; |
|
|
|
} |
|
|
|
const { items } = result.value; |
|
|
|
if (items?.length > 0) { |
|
|
|
lookupItems = lookupItems.concat(items); |
|
|
|
} |
|
|
|
|
|
@ -331,6 +331,7 @@ export class YahooFinanceService implements DataProviderInterface { |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
Logger.error(error, 'YahooFinanceService'); |
|
|
|
return { items: [] }; |
|
|
|
} |
|
|
|
|
|
|
|
return { items }; |
|
|
|