I'm trying to define a cronjob for a custom module, but having a hard time going through the proper flow of scheduled cronjobs.
Few things of note:
- It seems that third-party cronjobs are only scheduled once, when the cache is flushed. When the scheduled
./bin/magento cron:run
runs every minute, the first time the cache is flushed it picks up all of the third-party module cronjobs, and runs them on the next execution. - After the first run, it doesn't seem as though these third-party modules are scheduled for a second run, ever. Until the cache is flushed again.
- Is this perhaps related to cron group? I noticed that items in the
default
cron group never get rescheduled, but it seems that items in theindex
cron group do (at least items from core code). - Disabling the cache doesn't help.
- Even if cache is disabled, the third-party modules never get registered.
- Even if cache is disabled, iff a
./bin/magento cache:flush
is run, all of the items in thedefault
group do get scheduled. This leads me to believe that either that cache is not getting properly disabled, there is a bug in the caching system, and/or there is some sort of intricacy with how the cache actually works.
- Is this perhaps related to cron group? I noticed that items in the
- What is the purpose of running
php update/cron.php
if we are already running./bin/magento cron:run
, and what is the difference between the two? I'm pulling info from devdocs http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-bkg