protected function handleNotifications()
    {
        if (($this->exitcode > 0) && $this->scheduler->alert_on_fail) {
            return app(Eye::class)->notifier()->alert(new Error(['scheduler' => $this->scheduler,
                                                                 'exitcode' => $this->exitcode]));
        }

        if (($this->scheduler->alert_run_time_greater_than > 0) && ($this->history->time_to_run > $this->scheduler->alert_run_time_greater_than)) {
            return app(Eye::class)->notifier()->alert(new Slow(['scheduler' => $this->scheduler,
                                                                'time_to_run' => $this->history->time_to_run]));
        }

        if (($this->scheduler->alert_run_time_less_than > 0) && ($this->history->time_to_run < $this->scheduler->alert_run_time_less_than)) {
            return app(Eye::class)->notifier()->alert(new Fast(['scheduler' => $this->scheduler,
                                                                'time_to_run' => $this->history->time_to_run]));
        }

        if (! $this->scheduler->healthy) {
            if (! is_null($this->scheduler->healthy)) {
                app(Eye::class)->notifier()->alert(new Working(['scheduler' => $this->scheduler]));
            }

            $this->scheduler->healthy = true;
            $this->scheduler->save();
        }
    }