Browse Source

fff 2

master
gsd 10 months ago
parent
commit
d084fbbc1d
  1. 2
      src/main/java/app/controllers/StatsController.java

2
src/main/java/app/controllers/StatsController.java

@ -55,6 +55,8 @@ public class StatsController {
@GetMapping("/graph/peak/of/days")
public ResponseEntity<List<OnlineUpdater.StatsOfPeakOfDay>> 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());}});
}

Loading…
Cancel
Save