Uploaded image for project: 'Spring Data Redis'
  1. Spring Data Redis
  2. DATAREDIS-542

RedisCache.putIfAbsent does not set the TTL on the element

    XMLWordPrintable

    Details

      Description

      RedisCache.putIfAbsent does not set the TTL on the element in redis. This appears to be because the RedisCachePutIfAbsentCallback performs the wrong check to decide whether it should set the TTL.

      The check at
      https://github.com/spring-projects/spring-data-redis/blob/master/src/main/java/org/springframework/data/redis/cache/RedisCache.java#L725

      Looks like it should check for null being returned from the set rather than checking equality with the supplied value.

        Attachments

          Activity

            People

            Assignee:
            mp911de Mark Paluch
            Reporter:
            urquhart Steven Urquhart
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: