Question

I noticed the following in Mage_GoogleShopping:

  • I can add products to Google
  • Now an info is displayed "Synchronization is in progress"
  • I can leave the backend page and if I come back later, the process was finished.

How can this be implemented in an own extension?

I do not think it is done by a server side cron job, because the job seems to start very soon after I hit "submit".

And it can not be done in the webserver process, because I can close the browser and it continues its work.

Was it helpful?

Solution

Most likely the key is on line 123 of controllers/Adminhtml/Googleshopping/ItemsController.php:

ignore_user_abort(true);

OTHER TIPS

I never looked at Mage_GoogleShopping but as far as I know closing the browser won't stop the request that is being processed (this would support my guess) so it would be simple to implement an ajax call that would start synchronization and return a response when it would end so that the browser can show it to the user.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top