Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

GCRA.RESET

Last updated
GCRA.RESET key [key ...]
Group
Rate limiting
Complexity
O(n), n being the keys
Arity
-2 (at least 2 words, counting the command name)
Flags
write, fast
Keys
first 1, last final argument, step 1
HotKV Cloud
All plans
On-Premise
no license needed

GCRA.RESET deletes the rate limit state that GCRA.LIMIT keeps at each key, so the next request for that key starts with the full burst available.

It deletes the keys whatever they hold, like DEL, so only pass keys you use for rate limiting.

Case RESP2 RESP3
Always Integer: the number of keys deleted Integer
127.0.0.1:6379> GCRA.LIMIT ratelimit:user:42 60000 1
1) (integer) 0
2) (integer) 1
3) (integer) 0
4) (integer) -1
5) (integer) 60000
127.0.0.1:6379> GCRA.LIMIT ratelimit:user:42 60000 1
1) (integer) 1
2) (integer) 1
3) (integer) 0
4) (integer) 60000
5) (integer) 60000
127.0.0.1:6379> GCRA.RESET ratelimit:user:42 ratelimit:user:43
(integer) 1
127.0.0.1:6379> GCRA.LIMIT ratelimit:user:42 60000 1
1) (integer) 0
2) (integer) 1
3) (integer) 0
4) (integer) -1
5) (integer) 60000

The millisecond values depend on the time between calls.

HotKV-only command.

GCRA.LIMIT, DEL