diff --git a/src/main/java/app/controllers/StatsController.java b/src/main/java/app/controllers/StatsController.java index 6fd7cd3..241606e 100644 --- a/src/main/java/app/controllers/StatsController.java +++ b/src/main/java/app/controllers/StatsController.java @@ -58,12 +58,12 @@ public class StatsController { public ResponseEntity> GetPeakOfDays( @RequestParam(required = false, defaultValue = "7") Integer limit, @RequestParam(required = false, defaultValue = "%") String server_id) { - if (limit > 14) return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); + if (limit > 31) return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); if (!cache.containsKey(Map.of(limit, server_id))) { cache.put(Map.of(limit, server_id), new HashMap<>(){{put(onlineUpdater.getPeakOfDays(server_id, limit), Instant.now().getEpochSecond());}}); } - if (Instant.now().getEpochSecond() - cache.get(Map.of(limit, server_id)).values().stream().findFirst().orElse(0L) < 60L) { + if (Instant.now().getEpochSecond() - cache.get(Map.of(limit, server_id)).values().stream().findFirst().orElse(0L) > limit * 10) { cache.put(Map.of(limit, server_id), new HashMap<>(){{put(onlineUpdater.getPeakOfDays(server_id, limit), Instant.now().getEpochSecond());}}); }