fixbug
(cherry picked from commit 98aeae96) (cherry picked from commit b8cd93879c09eca2d23f6fd9f19e9f3a13a6db76)
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -32,7 +32,7 @@ public class RedisLock { | @@ -32,7 +32,7 @@ public class RedisLock { | ||
32 | public boolean acquire(RedisKeyBuilder keyBuilder, String value, final long timeout, final TimeUnit unit) { | 32 | public boolean acquire(RedisKeyBuilder keyBuilder, String value, final long timeout, final TimeUnit unit) { |
33 | try { | 33 | try { |
34 | String script = "return redis.call('set', KEYS[1],ARGV[1],ARGV[2],ARGV[3],ARGV[4])"; | 34 | String script = "return redis.call('set', KEYS[1],ARGV[1],ARGV[2],ARGV[3],ARGV[4])"; |
35 | - RedisScript<String> redisScript = new DefaultRedisScript(script, Long.class); | 35 | + RedisScript<String> redisScript = new DefaultRedisScript(script, String.class); |
36 | String key = keyBuilder.getKey(); | 36 | String key = keyBuilder.getKey(); |
37 | String result = redis.getStringRedisTemplate().execute(redisScript, Lists.newArrayList(key), | 37 | String result = redis.getStringRedisTemplate().execute(redisScript, Lists.newArrayList(key), |
38 | value, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, unit.toMillis(timeout)); | 38 | value, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, unit.toMillis(timeout)); |
-
Please register or login to post a comment