|
|
|
@ -194,8 +194,7 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
|
|
|
|
|
@Override
|
|
|
|
|
public Future<V> putIfAbsentAsync(K key, V value) {
|
|
|
|
|
return commandExecutor.evalWriteAsync(getName(), codec, EVAL_PUT,
|
|
|
|
|
"if redis.call('hexists', KEYS[1], ARGV[1]) == 0 then "
|
|
|
|
|
+ "redis.call('hset', KEYS[1], ARGV[1], ARGV[2]); "
|
|
|
|
|
"if redis.call('hsetnx', KEYS[1], ARGV[1], ARGV[2]) == 1 then "
|
|
|
|
|
+ "return nil "
|
|
|
|
|
+ "else "
|
|
|
|
|
+ "return redis.call('hget', KEYS[1], ARGV[1]) "
|
|
|
|
|