service = $service; } /** * The console command name. * * @var string */ protected $name = 'summit:admin-schedule-action-process'; /** * The console command description. * * @var string */ protected $description = 'Process Admin External Schedule Sync Actions'; /** * The name and signature of the console command. * * @var string */ protected $signature = 'summit:admin-schedule-action-process {batch_size?}'; public function handle() { $enabled = boolval(Config::get("cal_sync.enable_cal_sync", true)); if(!$enabled){ $this->info("task is not enabled!"); return false; } $batch_size = $this->argument('batch_size'); if(empty($batch_size)) $batch_size = PHP_INT_MAX; $start = time(); $this->info(sprintf("processing batch size of %s", $batch_size)); $res = $this->service->processActions($batch_size); $end = time(); $delta = $end - $start; $this->info(sprintf("execution call %s seconds - processed entries %s", $delta, $res)); } }