I created a custom cron job and tested on local server, where it needs to run
bin/magento cron:run
two times simultaneously and then that custom job is created and scheduled.
why is it like that ?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI created a custom cron job and tested on local server, where it needs to run
bin/magento cron:run
two times simultaneously and then that custom job is created and scheduled.
why is it like that ?
Because its made to work like this.
It's from Magento documentation
"You must run cron twice: the first time to discover tasks to run and the second time — to run the tasks themselves. The second cron run must occur on or after the scheduled_at time for every task"
https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html