From f3712b293cc351781d5ffeaaa0ce421a181c2bb9 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:29:28 +0100 Subject: [PATCH] Bugfix/fix exception in portfolio calculator (#4119) * Add guard * Update changelog --- CHANGELOG.md | 1 + .../queues/portfolio-snapshot/portfolio-snapshot.processor.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4e3e3b04..59f0c1bb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed an exception in the caching of the portfolio snapshot in the portfolio calculator - Fixed the import of `jsonpath` to support REST APIs (`JSON`) via the scraper configuration ## 2.127.0 - 2024-12-08 diff --git a/apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts b/apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts index 72e2a7ce3..93b34cbdf 100644 --- a/apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts +++ b/apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts @@ -86,7 +86,7 @@ export class PortfolioSnapshotProcessor { const expiration = addMilliseconds( new Date(), - snapshot.errors.length === 0 + (snapshot?.errors?.length ?? 0) === 0 ? this.configurationService.get('CACHE_QUOTES_TTL') : 0 );