|
|
|
@ -100,9 +100,6 @@ import org.springframework.data.redis.core.types.RedisClientInfo;
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
import org.springframework.util.ReflectionUtils;
|
|
|
|
|
|
|
|
|
|
import io.netty.util.concurrent.Future;
|
|
|
|
|
import io.netty.util.concurrent.FutureListener;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Redisson connection
|
|
|
|
|
*
|
|
|
|
@ -612,13 +609,13 @@ public class RedissonConnection extends AbstractRedisConnection {
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (option == null || option == SetOption.UPSERT) {
|
|
|
|
|
return write(key, StringCodec.INSTANCE, RedisCommands.SET, key, value, "PX", expiration.getExpirationTimeInMilliseconds());
|
|
|
|
|
return write(key, StringCodec.INSTANCE, SET, key, value, "PX", expiration.getExpirationTimeInMilliseconds());
|
|
|
|
|
}
|
|
|
|
|
if (option == SetOption.SET_IF_ABSENT) {
|
|
|
|
|
return write(key, StringCodec.INSTANCE, RedisCommands.SET, key, value, "PX", expiration.getExpirationTimeInMilliseconds(), "NX");
|
|
|
|
|
return write(key, StringCodec.INSTANCE, SET, key, value, "PX", expiration.getExpirationTimeInMilliseconds(), "NX");
|
|
|
|
|
}
|
|
|
|
|
if (option == SetOption.SET_IF_PRESENT) {
|
|
|
|
|
return write(key, StringCodec.INSTANCE, RedisCommands.SET, key, value, "PX", expiration.getExpirationTimeInMilliseconds(), "XX");
|
|
|
|
|
return write(key, StringCodec.INSTANCE, SET, key, value, "PX", expiration.getExpirationTimeInMilliseconds(), "XX");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
throw new IllegalArgumentException();
|
|
|
|
|