/** * Ensure there is a Cron worker running, before looping. * * @param type $arguments * @param type $options */ protected function preExecute($arguments = array(), $options = array()) { $this->createCloudControl(); $found = false; foreach ($this->getCloudControl()->getWorkerList() as $eachWorker) { $details = $this->getCloudControl()->getWorkerDetails($eachWorker->wrk_id); if (strpos($details->params, CronTask::getWorkerParamsString()) === 0) { $found = true; break; } } if (!$found) { throw new RuntimeException(CronTask::EXCEPTION_NO_PROCESS, CloudControlBaseTask::RETURN_CODE_ERROR); } }