Feature/introduce Promise.all() in getPerformance() of portfolio service (#4381)
* Introduce Promise.all() * Update changelog
This commit is contained in:
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Optimized the asynchronous operations using `Promise.all()` in the portfolio service (`getPerformance`)
|
||||
- Improved the symbol lookup in the _Trackinsight_ data enhancer for asset profile data
|
||||
|
||||
### Fixed
|
||||
|
@ -1081,19 +1081,18 @@ export class PortfolioService {
|
||||
const user = await this.userService.user({ id: userId });
|
||||
const userCurrency = this.getUserCurrency(user);
|
||||
|
||||
const accountBalanceItems =
|
||||
await this.accountBalanceService.getAccountBalanceItems({
|
||||
const [accountBalanceItems, { activities }] = await Promise.all([
|
||||
this.accountBalanceService.getAccountBalanceItems({
|
||||
filters,
|
||||
userId,
|
||||
userCurrency
|
||||
});
|
||||
|
||||
const { activities } =
|
||||
await this.orderService.getOrdersForPortfolioCalculator({
|
||||
}),
|
||||
this.orderService.getOrdersForPortfolioCalculator({
|
||||
filters,
|
||||
userCurrency,
|
||||
userId
|
||||
});
|
||||
})
|
||||
]);
|
||||
|
||||
if (accountBalanceItems.length === 0 && activities.length === 0) {
|
||||
return {
|
||||
|
Reference in New Issue
Block a user