public function cron() {
    // @todo Use config to stop/resume the runner.
    $prefix = 'openy_cron_';
    /** @var OpenyCronServiceInterface $service */
    foreach ($this->cronServices as $periodicity => $services) {
      foreach ($services as $service) {
        $name = $prefix . $service->_serviceId;
        $last_run = $this->state->get($name);
        if ((REQUEST_TIME - $last_run) > $periodicity) {
          // @todo Fix DI on OpenY sprint.
          \Drupal::logger("openy_cron")->info('Service %service has been started.', ['%service' => $service->_serviceId]);
          Timer::start($name);
          $service->runCronServices();
          $execution_time = Timer::read($name) / 1000;
          $this->state->set($name, REQUEST_TIME);
          \Drupal::logger("openy_cron")->info('Service %service has been finished. Execution time: %time sec.', ['%service' => $service->_serviceId, '%time' => $execution_time]);
          Timer::stop($name);
        }
      }
    }
  }
public function cron() {
    // @todo Use config to stop/resume the runner.
    $prefix = 'openy_cron_';
    /** @var OpenyCronServiceInterface $service */
    foreach ($this->cronServices as $periodicity => $services) {
      foreach ($services as $service) {
        $name = $prefix . $service->_serviceId;
        $last_run = $this->state->get($name);
        if ((REQUEST_TIME - $last_run) > $periodicity) {
          // @todo Fix DI on OpenY sprint.
          \Drupal::logger("openy_cron")->info('Service %service has been started.', ['%service' => $service->_serviceId]);
          Timer::start($name);
          $service->runCronServices();
          $execution_time = Timer::read($name) / 1000;
          $this->state->set($name, REQUEST_TIME);
          \Drupal::logger("openy_cron")->info('Service %service has been finished. Execution time: %time sec.', ['%service' => $service->_serviceId, '%time' => $execution_time]);
          Timer::stop($name);
        }
      }
    }
  }
public function cron ( ) { // @todo Use config to stop/resume the runner. $ prefix = 'openy_cron_' ; /** @var OpenyCronServiceInterface $service */ foreach ( $ this -> cronServices as $ periodicity => $ services ) { foreach ( $ services as $ service ) { $ name = $ prefix . $ service -> _serviceId ; $ last_run = $ this -> state -> get ( $ name ) ; if ( ( REQUEST_TIME - $ last_run ) > $ periodicity ) { // @todo Fix DI on OpenY sprint. \ Drupal :: logger ( "openy_cron" ) -> info ( 'Service %service has been started.' , [ '%service' => $ service -> _serviceId ] ) ; Timer :: start ( $ name ) ; $ service -> runCronServices ( ) ; $ execution_time = Timer :: read ( $ name ) / 1000 ; $ this -> state -> set ( $ name , REQUEST_TIME ) ; \ Drupal :: logger ( "openy_cron" ) -> info ( 'Service %service has been finished. Execution time: %time sec.' , [ '%service' => $ service -> _serviceId , '%time' => $ execution_time ] ) ; Timer :: stop ( $ name ) ; } } } }
Runner for all openy cron services.
Runner for all openy cron services .