test: fix maxSnapshotCacheTtl when is infinite

This commit is contained in:
2025-04-14 22:02:12 +02:00
parent a7f82e6bce
commit 9d4cc84c4e

View File

@@ -136,9 +136,11 @@ class ProjectionSnapshotRepositoryInRedis<E : Event<ID>, P : Projection<ID>, ID
logger.error { "Projection NOT saved (already exists)" }
} else {
logger.info { "Projection saved" }
if (snapshotCacheConfig.maxSnapshotCacheTtl.isFinite()) {
jedis.expire(projection.redisKey, snapshotCacheConfig.maxSnapshotCacheTtl.inWholeSeconds)
}
}
}
/**
* Apply events to the projection.