Browse Source

Extend portfolio snapshot cache key by performance calculation type

pull/7913/head
Thomas Kaul 4 weeks ago
parent
commit
4c39f0d59a
  1. 8
      apps/api/src/app/portfolio/calculator/portfolio-calculator.ts

8
apps/api/src/app/portfolio/calculator/portfolio-calculator.ts

@ -1208,9 +1208,11 @@ export abstract class PortfolioCalculator {
let cachedPortfolioSnapshot: PortfolioSnapshot | undefined;
let isCachedPortfolioSnapshotExpired = false;
const calculationType = this.getPerformanceCalculationType();
const portfolioSnapshotKey = this.redisCacheService.getPortfolioSnapshotKey(
{
calculationType: this.getPerformanceCalculationType(),
calculationType,
filters: this.filters,
userId: this.userId
}
@ -1249,7 +1251,7 @@ export abstract class PortfolioCalculator {
// Compute in the background
this.portfolioSnapshotService.addJobToQueue({
data: {
calculationType: this.getPerformanceCalculationType(),
calculationType,
filters: this.filters,
userCurrency: this.currency,
userId: this.userId
@ -1272,7 +1274,7 @@ export abstract class PortfolioCalculator {
// Wait for computation
await this.portfolioSnapshotService.addJobToQueue({
data: {
calculationType: this.getPerformanceCalculationType(),
calculationType,
filters: this.filters,
userCurrency: this.currency,
userId: this.userId

Loading…
Cancel
Save