params = $params; $limit = $this->getLimit(); $taskService = new TaskService([TaskService::OPTION_LIMIT => $limit]); $taskService->setServiceLocator($this->getServiceLocator()); $report = $taskService->runQueue(); return $report; } /** * Get max amount of tasks to run. * @return int */ protected function getLimit() { $limit = isset($this->params[0]) ? $this->params[0] : 0; return (int) $limit; } }