Skip to content

Commit

Permalink
update lua script
Browse files Browse the repository at this point in the history
`rpush` to `lpush` bug
  • Loading branch information
driftluo authored Dec 11, 2017
1 parent d67ccdd commit cabc82c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/visitor_log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cabc82c

Please sign in to comment.