コード例 #1
0
ファイル: RunCommand.php プロジェクト: ihatehandles/AbuseIO
 /**
  * Execute the console command.
  *
  * @return bool
  */
 public function handle()
 {
     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: ' . $this->argument('name'));
         $processer = new CollectorProcess($this->argument('name'));
         $processer->handle();
     } else {
         Log::info(get_class($this) . ': ' . 'Pushing collector into queue: ' . $this->argument('name'));
         $this->dispatch(new CollectorProcess($this->argument('name')));
     }
     return true;
 }
コード例 #2
0
 /**
  * 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;
 }