This PR fixes a problem in incremental blocking by rate limiter, where after a certain point the block time (which would grow with each subsequent block) would be longer than the TTL of the "how many times was this client blocked previously" counter (which is always 10 minutes). With this change we remember about previous blocks for 10 minutes plus the time of the actual block.
Also added some descriptive comments and improved variable names to make the code more readable.
Интеграционный с настоящим редисом может быть немного сложно (и относительно долго будет исполняться), а юнит, если всё замокать, можно попробовать, да.
This PR fixes a problem in incremental blocking by rate limiter, where after a certain point the block time (which would grow with each subsequent block) would be longer than the TTL of the "how many times was this client blocked previously" counter (which is always 10 minutes). With this change we remember about previous blocks for 10 minutes plus the time of the actual block.
Also added some descriptive comments and improved variable names to make the code more readable.