Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Set Default Scoring Cache Values (#516)
Browse files Browse the repository at this point in the history
* Before a game begins, or before any scores are captured, the Memcached is empty for multiple scoring values. This results in continual hits to the database.

* Scores are now cached at zero until the first capture is obtained.   This dramatically reduces the number of queries performed and the load on the server.
  • Loading branch information
justinwray authored and gsingh93 committed Jun 6, 2017
1 parent c5da9f7 commit ec996a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/models/MultiTeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ class MultiTeam extends Team {
);
$points_by_type->add(Pair {intval($team->get('id')), $type_pair});
}
} else {
$type_pair = Map {};
$type_pair->add(Pair {'quiz', 0});
$type_pair->add(Pair {'flag', 0});
$type_pair->add(Pair {'base', 0});
$points_by_type->add(Pair {intval($team->get('id')), $type_pair});
}
}
self::setMCRecords('POINTS_BY_TYPE', new Map($points_by_type));
Expand Down

0 comments on commit ec996a5

Please sign in to comment.