public function ForceRunController::forceRunSensor in Monitoring 8
Force runs a single sensor.
Parameters
\Drupal\monitoring\Entity\SensorConfig $monitoring_sensor_config:
Return value
\Symfony\Component\HttpFoundation\RedirectResponse
1 string reference to 'ForceRunController::forceRunSensor'
File
- src/
Controller/ ForceRunController.php, line 68
Class
Namespace
Drupal\monitoring\ControllerCode
public function forceRunSensor(SensorConfig $monitoring_sensor_config) {
$this->sensorRunner
->resetCache(array(
$monitoring_sensor_config
->id(),
));
$this
->messenger()
->addMessage($this
->t('Force run of the sensor @name executed.', array(
'@name' => $monitoring_sensor_config
->getLabel(),
)));
return $this
->redirect('monitoring.sensor_list');
}