AvS_FastSimpleImport icon indicating copy to clipboard operation
AvS_FastSimpleImport copied to clipboard

Sometimes parentless simple products

Open pquerner opened this issue 8 years ago • 0 comments

Disclaimer: Might not be a real issue here, but I had to write this behaviour down somewhere in case someone else encounters this problem.

My import script currently works like this:

(#normal import) (all php here)

  • process start
  • gather information from an outside API about my products with a specific identifier
  • build product array (simple products + configurable products)
  • import products
  • do product <> category relation
  • repeat with different specific product identifier (from api)

Which sadly results that almost all my simple products are parentless in the database, meaning they're not configured to a configurable product.

So I created a more "slow mode" to counter that behaviour:

(#slow import)

  • a shell script which gathers all unique product identifiers from an outside api
  • loop the identifiers (also in the shell)
  • call the import script (a php script) with one specific product identifier at a time
  • (do all the stuff from above but with just one identifier at a time and then simply exit the script)

so this results in 1 php process == 1 specific product identifier (#normal import) would look like 1 php process for EVERYTHING

It is significantly slower* than the (#normal import) process but it works: after the import is done with the second approach I dont have any parentless simple products, which was my goal.

  • = normal process import = ~3h to do everything slow process import = ~2d (!)

The question now is: how is this possible? Why does the snake bait its own tail after running for a long time? My best guess is that it may be cache related and that the magento import process has faulty data in its cache and therefore cannot garuantee its perfect import. But I cannot get around in debugging this behaviour because I simply dont know where to start looking.

Also, it might be index related but if I do a hard sql query in phpMyAdmin it also says theres no connection between product X(simple) and any product Y(configurable) so I dont think that its index related.

Any thoughts on this?

pquerner avatar Sep 23 '15 13:09 pquerner