Added beacon events

This commit is contained in:
James Brooks
2016-08-04 11:06:27 +01:00
parent 1559e5945d
commit 9da17e7c15
8 changed files with 182 additions and 0 deletions
+7
View File
@@ -17,6 +17,8 @@ use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\Metric;
use CachetHQ\Cachet\Models\User;
use CachetHQ\Cachet\Settings\Repository as Setting;
use CachetHQ\Cachet\Bus\Events\Beacon\BeaconWasSentEvent;
use CachetHQ\Cachet\Bus\Events\Beacon\BeaconFailedToSendEvent;
use Exception;
use GuzzleHttp\Client;
use Illuminate\Contracts\Config\Repository;
@@ -110,6 +112,11 @@ class Beacon implements BeaconContract
]);
} catch (Exception $e) {
// TODO: Log a warning that the beacon could not be sent.
event(new BeaconFailedToSendEvent());
return;
}
event(new BeaconWasSentEvent());
}
}