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,7 +136,9 @@ class ProjectionSnapshotRepositoryInRedis<E : Event<ID>, P : Projection<ID>, ID
logger.error { "Projection NOT saved (already exists)" } logger.error { "Projection NOT saved (already exists)" }
} else { } else {
logger.info { "Projection saved" } logger.info { "Projection saved" }
jedis.expire(projection.redisKey, snapshotCacheConfig.maxSnapshotCacheTtl.inWholeSeconds) if (snapshotCacheConfig.maxSnapshotCacheTtl.isFinite()) {
jedis.expire(projection.redisKey, snapshotCacheConfig.maxSnapshotCacheTtl.inWholeSeconds)
}
} }
} }