@@ -97,11 +97,12 @@ public void put(Object key, Object value) {
97
97
return ;
98
98
}
99
99
long expire = getExpire ();
100
+ value = toStoreValue (value );
100
101
if (expire > 0 ) {
101
- stringKeyRedisTemplate .opsForValue ().set (getKey (key ), toStoreValue ( value ) , expire , TimeUnit .MILLISECONDS );
102
+ stringKeyRedisTemplate .opsForValue ().set (getKey (key ), value , expire , TimeUnit .MILLISECONDS );
102
103
}
103
104
else {
104
- stringKeyRedisTemplate .opsForValue ().set (getKey (key ), toStoreValue ( value ) );
105
+ stringKeyRedisTemplate .opsForValue ().set (getKey (key ), value );
105
106
}
106
107
107
108
push (new CacheMessage (this .name , key ));
@@ -118,17 +119,17 @@ public ValueWrapper putIfAbsent(Object key, Object value) {
118
119
prevValue = stringKeyRedisTemplate .opsForValue ().get (cacheKey );
119
120
if (prevValue == null ) {
120
121
long expire = getExpire ();
122
+ value = toStoreValue (value );
121
123
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 );
124
125
}
125
126
else {
126
- stringKeyRedisTemplate .opsForValue ().set (getKey (key ), toStoreValue ( value ) );
127
+ stringKeyRedisTemplate .opsForValue ().set (getKey (key ), value );
127
128
}
128
129
129
130
push (new CacheMessage (this .name , key ));
130
131
131
- caffeineCache .put (key , toStoreValue ( value ) );
132
+ caffeineCache .put (key , value );
132
133
}
133
134
}
134
135
return toValueWrapper (prevValue );
0 commit comments