Don't send notifications when within maintenance window. Fixes #2720

This commit is contained in:
James Brooks
2017-09-14 19:02:34 +01:00
committed by Nico Stapelbroek
parent 8485821491
commit f53f88f950
6 changed files with 79 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ namespace CachetHQ\Cachet\Integrations\Core;
use CachetHQ\Cachet\Integrations\Contracts\System as SystemContract;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\Schedule;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Config\Repository;
@@ -102,6 +103,16 @@ class System implements SystemContract
return $status;
}
/**
* Determine if Cachet has any open maintenance windows.
*
* @return bool
*/
public function underMaintenance()
{
return Schedule::inProgress()->count() > 0;
}
/**
* Get the cachet version.
*