|
|
@ -654,7 +654,7 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
|
|
|
|
public RFuture<Boolean> trySetPermitsAsync(int permits) {
|
|
|
|
public RFuture<Boolean> trySetPermitsAsync(int permits) {
|
|
|
|
return commandExecutor.evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
|
|
|
|
return commandExecutor.evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
|
|
|
|
"local value = redis.call('get', KEYS[1]); " +
|
|
|
|
"local value = redis.call('get', KEYS[1]); " +
|
|
|
|
"if (value == false or value == 0) then "
|
|
|
|
"if (value == false) then "
|
|
|
|
+ "redis.call('set', KEYS[1], ARGV[1]); "
|
|
|
|
+ "redis.call('set', KEYS[1], ARGV[1]); "
|
|
|
|
+ "redis.call('publish', KEYS[2], ARGV[1]); "
|
|
|
|
+ "redis.call('publish', KEYS[2], ARGV[1]); "
|
|
|
|
+ "return 1;"
|
|
|
|
+ "return 1;"
|
|
|
|