Authored by LUOXC

fixbug

(cherry picked from commit 98aeae96)
(cherry picked from commit b8cd93879c09eca2d23f6fd9f19e9f3a13a6db76)
... ... @@ -32,7 +32,7 @@ public class RedisLock {
public boolean acquire(RedisKeyBuilder keyBuilder, String value, final long timeout, final TimeUnit unit) {
try {
String script = "return redis.call('set', KEYS[1],ARGV[1],ARGV[2],ARGV[3],ARGV[4])";
RedisScript<String> redisScript = new DefaultRedisScript(script, Long.class);
RedisScript<String> redisScript = new DefaultRedisScript(script, String.class);
String key = keyBuilder.getKey();
String result = redis.getStringRedisTemplate().execute(redisScript, Lists.newArrayList(key),
value, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, unit.toMillis(timeout));
... ...