Cache the amount of incidents we have

This commit is contained in:
James Brooks 2014-11-24 17:02:03 +00:00
parent 2a3cf0a52b
commit d67b36ad42

View File

@ -7,7 +7,9 @@
->groupBy('status')
->orderBy('status', 'desc');
if ($incidents->get()->count() <= 1 || ($incidents->get()->count() > 1 && (int) $incidents->first()->status === 4)) {
$incidentCount = $incidents->count();
if ($incidentCount <= 1 || ($incidentCount > 1 && (int) $incidents->first()->status === 4)) {
$status = 'success';
$message = 'All systems are functional.';
} else {