|
|
|
@ -197,12 +197,8 @@ public class RedissonLock extends RedissonBaseLock {
|
|
|
|
|
|
|
|
|
|
<T> RFuture<T> tryLockInnerAsync(long waitTime, long leaseTime, TimeUnit unit, long threadId, RedisStrictCommand<T> command) {
|
|
|
|
|
return evalWriteAsync(getRawName(), LongCodec.INSTANCE, command,
|
|
|
|
|
"if (redis.call('exists', KEYS[1]) == 0) then " +
|
|
|
|
|
"redis.call('hincrby', KEYS[1], ARGV[2], 1); " +
|
|
|
|
|
"redis.call('pexpire', KEYS[1], ARGV[1]); " +
|
|
|
|
|
"return nil; " +
|
|
|
|
|
"end; " +
|
|
|
|
|
"if (redis.call('hexists', KEYS[1], ARGV[2]) == 1) then " +
|
|
|
|
|
"if ((redis.call('exists', KEYS[1]) == 0) " +
|
|
|
|
|
"or (redis.call('hexists', KEYS[1], ARGV[2]) == 1)) then " +
|
|
|
|
|
"redis.call('hincrby', KEYS[1], ARGV[2], 1); " +
|
|
|
|
|
"redis.call('pexpire', KEYS[1], ARGV[1]); " +
|
|
|
|
|
"return nil; " +
|
|
|
|
|