diff --git a/packages/ep_products/Classes/Service/ApiImportSource.php b/packages/ep_products/Classes/Service/ApiImportSource.php index 4db2f73..e918751 100644 --- a/packages/ep_products/Classes/Service/ApiImportSource.php +++ b/packages/ep_products/Classes/Service/ApiImportSource.php @@ -37,7 +37,6 @@ final class ApiImportSource implements ProductImportSource, SingletonInterface, private const STAGING_SUBDIR = 'ep_products_import'; private const BASELINE_FILE = 'api-imported.info'; - private const IMPORT_MARKER = 'fileadmin/products_import.info'; /** * @var ApiClient|null @@ -93,8 +92,6 @@ final class ApiImportSource implements ProductImportSource, SingletonInterface, GeneralUtility::mkdir_deep(dirname($file)); GeneralUtility::writeFile($file, $sourceGeneratedAt->format(\DateTimeInterface::ATOM), false); } - - (new ImportTimestampService())->writeImportTimestamp(self::IMPORT_MARKER); } /** diff --git a/packages/ep_products/Classes/Service/ImportTimestampService.php b/packages/ep_products/Classes/Service/ImportTimestampService.php deleted file mode 100644 index c3bf175..0000000 --- a/packages/ep_products/Classes/Service/ImportTimestampService.php +++ /dev/null @@ -1,61 +0,0 @@ -format('d.m.Y H:i:s')); - } - - public function isImportRequired(string $uploadTimestampFile, string $importTimestampFile): bool - { - $updatedTimestampPath = GeneralUtility::getFileAbsFileName($uploadTimestampFile); - - if (!$updatedTimestampPath || !file_exists($updatedTimestampPath)) { - $this->writeImportTimestamp($importTimestampFile); - - return true; - } - - $line = trim(file($updatedTimestampPath)[0]); - - if (empty($line)) { - return true; - } - - $lastUploadAt = \DateTime::createFromFormat('d.m.Y H:i:s', $line); - - $lastImportAt = $this->readImportTimestamp($importTimestampFile); - - if (null === $lastImportAt || $lastUploadAt > $lastImportAt) { - $this->writeImportTimestamp($importTimestampFile); - - return true; - } - - return false; - } - -}