From 662b68583eefa9359c4a60d73944449e9d4a4440 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 5 Sep 2026 09:12:41 +0200 Subject: [PATCH] Bugfix/immediate expiration of portfolio snapshot with errors (#7815) * Fix immediate expiration of portfolio snapshot with errors * Update changelog --- CHANGELOG.md | 1 + .../portfolio-snapshot/portfolio-snapshot.processor.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23891b0d3..b808b9e0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed the immediate expiration of a portfolio snapshot with errors - Fixed the missing country mapping of _Congo (Dem. Rep. of the)_ and _Congo (Rep. of)_ in the _Financial Modeling Prep_ service ## 3.66.0 - 2026-09-03 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 06b87f733..a6fdcdd97 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 @@ -82,9 +82,7 @@ export class PortfolioSnapshotProcessor { const expiration = addMilliseconds( new Date(), - (snapshot?.errors?.length ?? 0) === 0 - ? this.configurationService.get('CACHE_QUOTES_TTL') - : 0 + this.configurationService.get('CACHE_QUOTES_TTL') ); await this.redisCacheService.set( @@ -101,7 +99,9 @@ export class PortfolioSnapshotProcessor { return snapshot; } catch (error) { - this.logger.error(error.message); + this.logger.error( + `Portfolio snapshot calculation of user '${job.data.userId}' has failed: ${error.message}` + ); throw new Error(error); }