- 🇺🇸United States freelock Seattle
We also see this on a site with > 50K links. Sometimes it generates 3 sitemap pages with exactly 10K links each, sometimes 2, sometimes none. When run manually from drush, it generates 6 pages, the first 5 10K links and the remainder on the 6th. But doing this today took 1 hour 24 minutes to complete...
We might try the workaround suggested -- disabling the cron generation and adding our own drush cron job... or give simple_sitemap a try.
- 🇵🇱Poland piotr pakulski Poland 🇪🇺
I'm also experiencing that cron is not reliable. In my case when I unpublished some node in EN language, in meantime corn regenerate the sitemap then I unpublished the other language version of the same node, then the crone simply does not include that change into the other language sitemap. Walk-around will be setting crone drush command to rebuild the sitemap. I do not want invest more time into investigating that.
- 🇲🇽Mexico dalin 🇨🇦, 🇲🇽, 🌍
Note that you can adjust at
/admin/config/search/xmlsitemap/settings
I set it to process only 50 items at once rather than the default 100, and it now successfully completes. - 🇲🇽Mexico dalin 🇨🇦, 🇲🇽, 🌍
Actually, that wasn't working reliably. But throwing this into a custom module seems to be working:
/** * Implements hook_cron(). */ function mymodule_cron() { $logger = Drupal::logger('mymodule); $logger->info('Starting `drush xmlsitemap:rebuild` asynchronously. It will take about 10 minutes to complete.'); pclose(popen("drush xmlsitemap:rebuild &","r")); }
I wonder if we should roll this into the module as an option:
* Run as a normal cron hook
* Run as an asynchronous cron hook (requires drush)
* Don't run during cron