限流返回类型转换数值型的格式
This commit is contained in:
parent
1a5881b1d0
commit
f8cc7ce328
|
@ -68,12 +68,12 @@ public class RedisConfig extends CachingConfigurerSupport
|
||||||
"local time = tonumber(ARGV[2])\n" +
|
"local time = tonumber(ARGV[2])\n" +
|
||||||
"local current = redis.call('get', key);\n" +
|
"local current = redis.call('get', key);\n" +
|
||||||
"if current and tonumber(current) > count then\n" +
|
"if current and tonumber(current) > count then\n" +
|
||||||
" return current;\n" +
|
" return tonumber(current);\n" +
|
||||||
"end\n" +
|
"end\n" +
|
||||||
"current = redis.call('incr', key)\n" +
|
"current = redis.call('incr', key)\n" +
|
||||||
"if tonumber(current) == 1 then\n" +
|
"if tonumber(current) == 1 then\n" +
|
||||||
" redis.call('expire', key, time)\n" +
|
" redis.call('expire', key, time)\n" +
|
||||||
"end\n" +
|
"end\n" +
|
||||||
"return current;";
|
"return tonumber(current);";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue