From 94ed41ee6f3e612efbd4595378b1599b284033a5 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Thu, 31 Oct 2024 07:58:50 -0500 Subject: [PATCH] use cached scores --- app/Actions/Tabulation/AllowForOlympicScoring.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Actions/Tabulation/AllowForOlympicScoring.php b/app/Actions/Tabulation/AllowForOlympicScoring.php index 483088b..be88354 100644 --- a/app/Actions/Tabulation/AllowForOlympicScoring.php +++ b/app/Actions/Tabulation/AllowForOlympicScoring.php @@ -35,6 +35,10 @@ class AllowForOlympicScoring implements CalculateEntryScore public function calculate(string $mode, Entry $entry): array { + $calculated = CalculatedScore::where('entry_id', $entry->id)->where('mode', $mode)->first(); + if ($calculated) { + return $calculated->calculatedScore; + } $cacheKey = 'entryScore-'.$entry->id.'-'.$mode;