storageUid > 0) { $storage = GeneralUtility::makeInstance(StorageRepository::class)->findByUid($this->storageUid); if ($storage === null) { throw new \RuntimeException(self::class . ' misconfiguration: "Storage to index" must be an existing storage.', 1615020909); } $currentEvaluatePermissionsValue = $storage->getEvaluatePermissions(); $storage->setEvaluatePermissions(false); $indexer = $this->getIndexer($storage); try { $indexer->runMetaDataExtraction((int)$this->maxFileCount); $success = true; } catch (\Exception $e) { $success = false; $this->logException($e); } $storage->setEvaluatePermissions($currentEvaluatePermissionsValue); } return $success; } protected function getIndexer(ResourceStorage $storage): Indexer { return GeneralUtility::makeInstance(Indexer::class, $storage); } public function getTaskParameters(): array { return [ 'file_storage' => $this->storageUid, 'max_file_count' => $this->maxFileCount, ]; } public function setTaskParameters(array $parameters): void { $this->storageUid = (int)($parameters['storageUid'] ?? $parameters['file_storage'] ?? -1); $this->maxFileCount = (int)($parameters['maxFileCount'] ?? $parameters['max_file_count'] ?? 100); } }