Commit 70cc30f3 authored by Pawel G's avatar Pawel G

Issue #3070304 by ndobromirov, gbyte.co: Tuning the worker script

parent 044f9fdc
...@@ -300,7 +300,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase { ...@@ -300,7 +300,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
$form['simple_sitemap_settings']['advanced']['remove_duplicates'] = [ $form['simple_sitemap_settings']['advanced']['remove_duplicates'] = [
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => $this->t('Exclude duplicate links'), '#title' => $this->t('Exclude duplicate links'),
'#description' => $this->t('Prevent per-sitemap variant duplicate links.<br>Uncheck this to significantly speed up the sitemap generation process on a huge site (more than 20 000 indexed entities).'), '#description' => $this->t('Prevent per-sitemap variant duplicate links.<br>Unchecking this may help avoiding PHP memory errors on huge sites.'),
'#default_value' => $this->generator->getSetting('remove_duplicates', TRUE), '#default_value' => $this->generator->getSetting('remove_duplicates', TRUE),
]; ];
......
...@@ -273,11 +273,11 @@ class QueueWorker { ...@@ -273,11 +273,11 @@ class QueueWorker {
if ($this->generatorSettings['remove_duplicates'] && !empty($results)) { if ($this->generatorSettings['remove_duplicates'] && !empty($results)) {
$result = $results[key($results)]; $result = $results[key($results)];
if (isset($result['meta']['path'])) { if (isset($result['meta']['path'])) {
if (in_array($result['meta']['path'], $this->processedPaths)) { if (isset($this->processedPaths[$result['meta']['path']])) {
$results = []; $results = [];
} }
else { else {
$this->processedPaths[] = $result['meta']['path']; $this->processedPaths[$result['meta']['path']] = TRUE;
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment