@@ -97,11 +97,12 @@ public void put(Object key, Object value) {
9797 return ;
9898 }
9999 long expire = getExpire ();
100+ value = toStoreValue (value );
100101 if (expire > 0 ) {
101- stringKeyRedisTemplate .opsForValue ().set (getKey (key ), toStoreValue ( value ) , expire , TimeUnit .MILLISECONDS );
102+ stringKeyRedisTemplate .opsForValue ().set (getKey (key ), value , expire , TimeUnit .MILLISECONDS );
102103 }
103104 else {
104- stringKeyRedisTemplate .opsForValue ().set (getKey (key ), toStoreValue ( value ) );
105+ stringKeyRedisTemplate .opsForValue ().set (getKey (key ), value );
105106 }
106107
107108 push (new CacheMessage (this .name , key ));
@@ -118,17 +119,17 @@ public ValueWrapper putIfAbsent(Object key, Object value) {
118119 prevValue = stringKeyRedisTemplate .opsForValue ().get (cacheKey );
119120 if (prevValue == null ) {
120121 long expire = getExpire ();
122+ value = toStoreValue (value );
121123 if (expire > 0 ) {
122- stringKeyRedisTemplate .opsForValue ().set (getKey (key ), toStoreValue (value ), expire ,
123- TimeUnit .MILLISECONDS );
124+ stringKeyRedisTemplate .opsForValue ().set (getKey (key ), value , expire , TimeUnit .MILLISECONDS );
124125 }
125126 else {
126- stringKeyRedisTemplate .opsForValue ().set (getKey (key ), toStoreValue ( value ) );
127+ stringKeyRedisTemplate .opsForValue ().set (getKey (key ), value );
127128 }
128129
129130 push (new CacheMessage (this .name , key ));
130131
131- caffeineCache .put (key , toStoreValue ( value ) );
132+ caffeineCache .put (key , value );
132133 }
133134 }
134135 return toValueWrapper (prevValue );
0 commit comments