use cached scores

This commit is contained in:
Matt Young 2024-10-31 07:58:50 -05:00
parent 8f7a333898
commit 94ed41ee6f
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,10 @@ class AllowForOlympicScoring implements CalculateEntryScore
public function calculate(string $mode, Entry $entry): array 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; $cacheKey = 'entryScore-'.$entry->id.'-'.$mode;