From bc4802d0d5f98516bd79415bf976960cfa9e6ec7 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Tue, 18 Apr 2017 15:04:43 -0600 Subject: [PATCH] polish --- .../cloud/gateway/filter/ratelimit/RedisRateLimiter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java index 27bb2b32..c3811ba8 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java @@ -35,7 +35,7 @@ public class RedisRateLimiter implements RateLimiter { * @return */ @Override - //TODO: signature? params (tuple?). Return type, tokens left? + //TODO: signature? params (tuple?). public Response isAllowed(String id, int replenishRate, int burstCapacity) { try { @@ -46,7 +46,7 @@ public class RedisRateLimiter implements RateLimiter { List keys = Arrays.asList(prefix + ".tokens", prefix + ".timestamp"); // The arguments to the LUA script. time() returns unixtime in seconds. - String[] args = new String[]{ replenishRate+"", burstCapacity +"", Instant.now().getEpochSecond()+"", "1"}; + Object[] args = new String[]{ replenishRate+"", burstCapacity +"", Instant.now().getEpochSecond()+"", "1"}; // allowed, tokens_left = redis.eval(SCRIPT, keys, args) List results = this.redisTemplate.execute(this.script, keys, args);