spring-projects / spring-projects/spring-data-redis
Refactor duplicated TTL computation in DefaultRedisCacheWriter's get method
Open
@christophstrobl is already working on this.
Since Nov 24, 2025.
type: task
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Problem
In DefaultRedisCacheWriter's get method, following expression is evaluated twice
timeToIdleEnabled && withTtl ? ttl : null
Proposed Improvement
Extract the conditional TTL evaluation into a single variable
Duration ttlForGet = (timeToIdleEnabled && withTtl ? ttl : null);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.