Created
October 16, 2018 14:29
-
-
Save Berkodev/952f51b615d22e2cef38050832635186 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local cnt = redis.call('INCR', KEYS[1]) | |
| if cnt > tonumber(ARGV[1]) | |
| then | |
| return redis.call('PTTL', KEYS[1]) | |
| end | |
| if cnt == 1 | |
| then | |
| redis.call('PEXPIRE', KEYS[1], ARGV[2]) | |
| end | |
| return 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment