Skip to content
Snippets Groups Projects
Commit c957542e authored by Thibault Debatty's avatar Thibault Debatty
Browse files

only send a notification is server changes to status 'error'

parent f79d7845
No related branches found
No related tags found
No related merge requests found
Pipeline #10870 failed
......@@ -68,6 +68,11 @@ class StatusChangeDetection implements ShouldQueue
public function sendNotificationIfRequired(StatusChange $change)
{
// Only send a notification if server changes to status "error"
if ($change->status < \App\Status::ERROR) {
return;
}
$server = $change->server();
$server_id = $server->id;
......
......@@ -46,8 +46,9 @@ class Heartbeat extends \App\AbstractSensor
$delta = \time() - $record->time;
}
// > 15 minutes
if ($delta > 900) {
return \App\Status::WARNING;
return \App\Status::ERROR;
}
return \App\Status::OK;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment