|
@@ -54,8 +54,7 @@ public final class SimpleRedisClient implements RedisClient {
|
|
|
public void set(String key, Object value, int timeout) {
|
|
|
long s = System.currentTimeMillis();
|
|
|
beforeMethod();
|
|
|
- set(key, value);
|
|
|
- expire(key, timeout);
|
|
|
+ redisTemplate.opsForValue().set(key, value,timeout,TimeUnit.SECONDS);
|
|
|
afterMethod("set(String key, Object value, int timeout)", s);
|
|
|
}
|
|
|
|
|
@@ -104,8 +103,8 @@ public final class SimpleRedisClient implements RedisClient {
|
|
|
afterMethod("get(String key, Class<T> c)", s);
|
|
|
return t;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public <T> T get(String key,String hashKey, Class<T> c) {
|
|
|
long s = System.currentTimeMillis();
|
|
@@ -161,10 +160,10 @@ public final class SimpleRedisClient implements RedisClient {
|
|
|
public void set(String key, String subkey, Object value, int timeout) {
|
|
|
long s = System.currentTimeMillis();
|
|
|
beforeMethod();
|
|
|
- set(key,subkey, value);
|
|
|
- expire(key, timeout);
|
|
|
+ expire(key, timeout);
|
|
|
+ set(key,subkey, value);
|
|
|
afterMethod("set(String key,String subkey,Object value, int timeout)", s);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -183,4 +182,4 @@ public final class SimpleRedisClient implements RedisClient {
|
|
|
afterMethod("set(String key,String subkey, Object value)", s);
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+}
|