public function __construct( private readonly MessageBusInterface
$messageBus,
private readonly ImportExportFactory
$importExportFactory ) { } public function __invoke(ImportExportMessage
$message): void
{ $context =
$message->
getContext();
$importExport =
$this->importExportFactory->
create($message->
getLogId(), 50, 50
);
$logEntity =
$importExport->
getLogEntity();
if ($logEntity->
getState() === Progress::STATE_ABORTED
) { return;
} if ( $logEntity->
getActivity() === ImportExportLogEntity::ACTIVITY_IMPORT
||
$logEntity->
getActivity() === ImportExportLogEntity::ACTIVITY_DRYRUN
) { $progress =
$importExport->
import($context,
$message->
getOffset());
}