You are here

public function HaltedTasksCheck::check in Webform Scheduled Tasks 8.2

File

src/Plugin/HealthzCheck/HaltedTasksCheck.php, line 22

Class

HaltedTasksCheck
Provides a check for halted scheduled tasks.

Namespace

Drupal\webform_scheduled_tasks\Plugin\HealthzCheck

Code

public function check() {

  /** @var \Drupal\webform_scheduled_tasks\Entity\WebformScheduledTaskInterface[] $schedules */
  $schedules = WebformScheduledTask::loadMultiple();
  foreach ($schedules as $schedule) {
    if ($schedule
      ->isHalted()) {
      return FALSE;
    }
  }
  return TRUE;
}