$progress->
setOffset($this->reader->
getOffset());
$this->eventDispatcher->
removeListener(WriteCommandExceptionEvent::
class,
$this->
onWriteException(...
));
if (!
empty($failedRecords)) { $invalidRecordsProgress =
$this->
exportInvalid($context,
$failedRecords);
$progress->
setInvalidRecordsLogId($invalidRecordsProgress->
getLogId());
} // importing the file is complete
if ($this->reader->
getOffset() ===
$this->filesystem->
fileSize($path)) { if ($this->logEntity->
getInvalidRecordsLog() instanceof ImportExportLogEntity
) { /** @var ImportExportLogEntity $invalidLog */
$invalidLog =
$this->logEntity->
getInvalidRecordsLog();
$invalidRecordsProgress ??=
$this->importExportService->
getProgress($invalidLog->
getId(),
$invalidLog->
getRecords());
// complete invalid records export
$this->
mergePartFiles($invalidLog,
$invalidRecordsProgress);
$invalidRecordsProgress->
setState(Progress::STATE_SUCCEEDED
);
$this->importExportService->
saveProgress($invalidRecordsProgress);
}