I am working on creating a custom module that fetches categories and products from a third party app (store) to magento2 using apis. This module is divided into four parts:

  • Category collect
  • Category import
  • Product collect
  • Product import

I have almost completed it. But now I am stuck with the cron. I want my module should run in the above sequence only i.e "Category collect" process should run first then category import, after this product collect and then product import.

But the issue is if I am setting the cron for these processes say 'category collect' is running after 15 minutes, 'category import after 20 minutes', 'product collect' after 25 minutes, and 'product import' after 25 minutes, then sometime in future they will overlap. How I should set cron so that these processess run in sequence and also not overlap with each other.

  • Possible solution for this is to merge all this crons in one and then process them by sequence – Piyush Nov 6 at 11:28
  • Yes this could be the solution but then it will keep running for quite long time. I need to run it with a time interval of 5 minutes – Rajeev Singh Nov 6 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.