Skip to content

Commit

Permalink
Forcing cache entry invalidation by a getter after deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-odysseus committed Nov 15, 2024
1 parent 3f31277 commit 1637ad9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public CacheResult computeCacheIfAbsent(CohortDefinition cohortDefinition, Sourc
log.info(messagePrefix + " for cohort id = {}. Calculating with design hash = {}", cohortDefinition.getId(), designHash);
// Ensure that there are no records in results schema with which we could mess up
generationCacheService.removeCache(type, source, designHash);
// the line below forces a cached entry to be really deleted and it is a bit unclear why this line was even present as the cache had to be null anyway
// without it there is a constraint violation exception when there was a cache entry present and the retain covariates option is on
GenerationCache cachedResultsStillPresent = generationCacheService.getCacheOrEraseInvalid(type, designHash, source.getSourceId());
CohortGenerationRequest cohortGenerationRequest = requestBuilder
.withExpression(cohortDefinition.getDetails().getExpressionObject())
.withSource(source)
Expand Down

0 comments on commit 1637ad9

Please sign in to comment.