From cabc82c6116ea8f2723f62609082c6175ecbf0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BC=82=E6=B5=81?= Date: Mon, 11 Dec 2017 12:55:18 +0800 Subject: [PATCH] update lua script `rpush` to `lpush` bug --- lua/visitor_log.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/visitor_log.lua b/lua/visitor_log.lua index 5a41e73..b47739c 100644 --- a/lua/visitor_log.lua +++ b/lua/visitor_log.lua @@ -5,7 +5,7 @@ local len = redis.call("llen", redis_key); redis.call("lpush", redis_key, ip) if len > 100 then - redis.call("ltrim", redis_key, len - 99, len) + redis.call("ltrim", redis_key, 0, 100 - 1) end return true