/** * Execute the console command. * * @return bool */ public function handle() { Log::info(get_class($this) . ': ' . 'Starting a collection run for all enabled collectors'); $collectors = collectorFactory::getCollectors(); foreach ($collectors as $collectorName) { if (config("collectors.{$collectorName}.collector.enabled") === true) { if ($this->option('noqueue') == true) { // In debug mode we don't queue the job Log::debug(get_class($this) . ': ' . 'Queuing disabled. Directly handling message file: ' . $collectorName); $processer = new CollectorProcess($collectorName); $processer->handle(); } else { Log::info(get_class($this) . ': ' . 'Pushing collector into queue: ' . $collectorName); $this->dispatch(new CollectorProcess($collectorName)); } } } Log::info('Completed collections startup for all enabled collectors'); return true; }
/** * {@inheritdoc } */ protected function findAll() { $collectors = collectorFactory::getCollectors(); return $this->hydrateCollectorsWithDescription($collectors); }