diff --git a/src/main/java/app/controllers/StatsController.java b/src/main/java/app/controllers/StatsController.java index 17181fb..fb4b4fc 100644 --- a/src/main/java/app/controllers/StatsController.java +++ b/src/main/java/app/controllers/StatsController.java @@ -55,6 +55,8 @@ public class StatsController { @GetMapping("/graph/peak/of/days") public ResponseEntity> GetPeakOfDays(@RequestParam(required = false, defaultValue = "7") Integer limit) { + if (limit > 14) return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); + if (!cache.containsKey(limit)) { cache.put(limit, new HashMap<>(){{put(onlineUpdater.getPeakOfDays(limit), Instant.now().getEpochSecond());}}); }