Browse Source

Bugfix/immediate expiration of portfolio snapshot with errors (#7815)

* Fix immediate expiration of portfolio snapshot with errors

* Update changelog
pull/7817/head^2
Thomas Kaul 3 days ago
committed by GitHub
parent
commit
662b68583e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 8
      apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts

1
CHANGELOG.md

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### 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 - 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 ## 3.66.0 - 2026-09-03

8
apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts

@ -82,9 +82,7 @@ export class PortfolioSnapshotProcessor {
const expiration = addMilliseconds( const expiration = addMilliseconds(
new Date(), new Date(),
(snapshot?.errors?.length ?? 0) === 0 this.configurationService.get('CACHE_QUOTES_TTL')
? this.configurationService.get('CACHE_QUOTES_TTL')
: 0
); );
await this.redisCacheService.set( await this.redisCacheService.set(
@ -101,7 +99,9 @@ export class PortfolioSnapshotProcessor {
return snapshot; return snapshot;
} catch (error) { } 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); throw new Error(error);
} }

Loading…
Cancel
Save