jobList = $jobList; $this->logger = $logger; $this->queue = $queue; } /** * Configure the command * * @return void */ protected function configure() { $this->setName('recognize:recrawl') ->setDescription('Go through all files again'); } /** * Execute the command * * @param InputInterface $input * @param OutputInterface $output * * @return int */ protected function execute(InputInterface $input, OutputInterface $output): int { try { $this->queue->clearQueue('imagenet'); $this->queue->clearQueue('faces'); $this->queue->clearQueue('landmarks'); $this->queue->clearQueue('movinet'); $this->queue->clearQueue('musicnn'); $this->jobList->remove(ClassifyFacesJob::class); $this->jobList->remove(ClassifyImagenetJob::class); $this->jobList->remove(ClassifyLandmarksJob::class); $this->jobList->remove(ClassifyMusicnnJob::class); $this->jobList->remove(ClassifyMovinetJob::class); $this->jobList->remove(ClusterFacesJob::class); $this->jobList->remove(SchedulerJob::class); $this->jobList->remove(StorageCrawlJob::class); $this->jobList->add(SchedulerJob::class); } catch (\Exception $ex) { $output->writeln('Failed to schedule recrawl'); $output->writeln($ex->getMessage()); $this->logger->error('Failed to schedule recrawl: '.$ex->getMessage(), ['exception' => $ex]); return 1; } return 0; } }