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.