service = $service; } /** * The console command name. * * @var string */ protected $name = 'summit:member-schedule-action-process'; /** * The console command description. * * @var string */ protected $description = 'Process Member External Schedule Sync Actions'; /** * The name and signature of the console command. * * @var string */ protected $signature = 'summit:member-schedule-action-process {provider} {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'); $provider = $this->argument('provider'); if(!CalendarSyncInfo::isValidProvider($provider)){ $this->error("provider param is not valid , valid values are [Google, Outlook, iCloud]"); log::error("provider param is not valid , valid values are [Google, Outlook, iCloud]"); return false; } if(empty($batch_size)) $batch_size = 1000; $start = time(); $this->info(sprintf("processing provider %s - batch size of %s", $provider, $batch_size)); log::info(sprintf("processing provider %s - batch size of %s", $provider, $batch_size)); $res = $this->service->processActions($provider, $batch_size); $end = time(); $delta = $end - $start; $this->info(sprintf("execution call %s seconds - processed entries %s", $delta, $res)); log::info(sprintf("execution call %s seconds - processed entries %s", $delta, $res)); } }