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
| #!/bin/bash | |
| db_set () { | |
| echo "$1,$2" >> database | |
| } | |
| db_get () { | |
| grep "^$1," database | sed -e "s/^$1,//" | tail -n 1 | |
| } | |
| db_set video1 '1' |
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
| @RestController | |
| @RequestMapping("/ratelimiter") | |
| public class FixedWindowRateLimiter { | |
| private final @NotNull Jedis jedis; | |
| public FixedWindowRateLimiter(@NotNull Jedis jedis){ | |
| this.jedis = jedis; |