force result for Srp#exec when not in pipeline
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.data.redis.RedisConnectionFailureException;
|
||||
@@ -386,9 +387,11 @@ public class SrpConnection implements RedisConnection {
|
||||
public List<Object> exec() {
|
||||
isMulti = false;
|
||||
try {
|
||||
// if (isPipelined()) {
|
||||
return Collections.singletonList((Object) client.exec());
|
||||
// }
|
||||
Future<Boolean> exec = client.exec();
|
||||
if (!isPipelined()) {
|
||||
exec.get();
|
||||
}
|
||||
return Collections.singletonList((Object) exec);
|
||||
} catch (Exception ex) {
|
||||
throw convertSRAccessException(ex);
|
||||
}
|
||||
|
||||
@@ -17,12 +17,14 @@
|
||||
package org.springframework.data.redis.cache;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.Cache.ValueWrapper;
|
||||
|
||||
/**
|
||||
* Test for native cache implementations.
|
||||
@@ -64,9 +66,12 @@ public abstract class AbstractNativeCacheTest<T> {
|
||||
Object key = getObject();
|
||||
Object value = getObject();
|
||||
|
||||
assertNotNull(value);
|
||||
assertNull(cache.get(key));
|
||||
cache.put(key, value);
|
||||
assertEquals(value, cache.get(key).get());
|
||||
ValueWrapper valueWrapper = cache.get(key);
|
||||
assertNotNull(valueWrapper);
|
||||
assertEquals(value, valueWrapper.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user