BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Dataportqueue with Command #168

Open amogjackie opened 1 month ago

amogjackie commented 1 month ago

We have some Dataports for Daily import. Also wie have "Debug-Import-Dataports" for a initial Full-Import. Now wie build a Command in it loops over all Dataports and execute the dd:complete Command with the dataportId in our order we need, simple way ->

foreach ($inputIds as $inputId) { $newInput = new ArrayInput([ 'command' => 'dd:complete', 'dataport' => $inputId ]); $this->getApplication()->doRun($newInput, $output); }

In Datadirector 3.5 it worked fine and did its job. now we updated to Datadirector 3.6.33 and it imports every Dataobject into one Folder, the first folder was created with the first Dataport in row. Every Dataport has a different Targetfolder and should be created with new Command-call We use Pimcore 11.2.3 (with dd 3.5 and now 3.6.33) Maybe there is an other Way to run all Dataports as Command?

BlackbitDevs commented 1 month ago

The problem here is that the Importer object gets shared between the different dataports this way. And the target folder gets cached now.

Please do it this way:

foreach ($inputIds as $inputId) {
  \Blackbit\DataDirectorBundle\lib\Pim\Cli::exec('bin/console data-director:complete '.$inputId);
}

This way all imports get executed in separate processes. Nevertheless I will check if I can reset the Importer at the beginning of dd:complete command - because what worked before an update should also work after...