From d084fbbc1da9717149499f4d1553a8c0436a1d7f Mon Sep 17 00:00:00 2001 From: gsd Date: Sat, 25 May 2024 23:05:02 +0300 Subject: [PATCH] fff 2 --- src/main/java/app/controllers/StatsController.java | 2 ++ 1 file changed, 2 insertions(+) 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());}}); }