Skip to content

Instantly share code, notes, and snippets.

@colepacak
Created February 6, 2018 22:12
Show Gist options
  • Save colepacak/64082e54d54c10ee0a93c19ce721d02a to your computer and use it in GitHub Desktop.
Save colepacak/64082e54d54c10ee0a93c19ce721d02a to your computer and use it in GitHub Desktop.
diff --git a/src/XmlSitemapWriter.php b/src/XmlSitemapWriter.php
index 6497da2..8f22722 100644
--- a/src/XmlSitemapWriter.php
+++ b/src/XmlSitemapWriter.php
@@ -157,6 +157,8 @@ class XmlSitemapWriter extends \XMLWriter {
*/
public function generateXML() {
// @codingStandardsIgnoreEnd
+ // Clear out the node static cache once the chunk has finished.
+ \Drupal::entityTypeManager()->getStorage('node')->resetCache();
return \Drupal::service('xmlsitemap_generator')->generateChunk($this->sitemap, $this, $this->sitemap_page);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment