Skip to content

Commit

Permalink
Clone to prevent scoping incorrectly. Fixes #2430
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Mar 18, 2017
1 parent 6e046a4 commit 1529720
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Integrations/Core/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function __construct(Repository $config)
public function getStatus()
{
$enabledScope = Component::enabled();
$totalComponents = $enabledScope->count();
$majorOutages = $enabledScope->status(4)->count();
$totalComponents = (clone $enabledScope)->count();
$majorOutages = (clone $enabledScope)->status(4)->count();
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents) >= 0.5 : false;

// Default data
Expand Down

0 comments on commit 1529720

Please sign in to comment.