Skip to content

Refactor duplicated TTL computation in DefaultRedisCacheWriter's get method #3266

@diydriller

Description

@diydriller

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);

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions