From edd956a8eee9ea7d833885deb9dd27073f2c0220 Mon Sep 17 00:00:00 2001 From: FleetAdmiralButter Date: Fri, 23 Jul 2021 13:37:57 +1000 Subject: [PATCH 1/3] [SRM-14] : Increases batch size --- tide_news.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tide_news.install b/tide_news.install index c6ef35e..241ea10 100644 --- a/tide_news.install +++ b/tide_news.install @@ -130,7 +130,7 @@ function tide_news_update_8003(&$sandbox) { $sandbox['#finished'] = $count ? 0 : 1; } - $batch_size = 10; + $batch_size = 100; $nids = \Drupal::entityQuery('node') ->condition('type', 'news') ->condition('nid', $sandbox['current'], '>') From 0b85e14522b63a03331a0bfd2a40e3089b9b6658 Mon Sep 17 00:00:00 2001 From: Ming Quah Date: Mon, 26 Jul 2021 12:11:11 +1000 Subject: [PATCH 2/3] Fixes entityQuery to get only nodes with a populated body.summary field --- tide_news.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tide_news.install b/tide_news.install index 241ea10..d912d5a 100644 --- a/tide_news.install +++ b/tide_news.install @@ -121,7 +121,7 @@ function tide_news_update_8003(&$sandbox) { if (!isset($sandbox['total'])) { $count = \Drupal::entityQuery('node') ->condition('type', 'news') - ->exists('body.summary') + ->condition('body.summary', '', '<>') ->count() ->execute(); $sandbox['total'] = $count; @@ -134,7 +134,7 @@ function tide_news_update_8003(&$sandbox) { $nids = \Drupal::entityQuery('node') ->condition('type', 'news') ->condition('nid', $sandbox['current'], '>') - ->exists('body.summary') + ->condition('body.summary', '', '<>') ->sort('nid', 'ASC') ->range(0, $batch_size) ->execute(); From bf7b71b4f1572b4936e95bccb164b0e6d4341b0f Mon Sep 17 00:00:00 2001 From: Ming Quah Date: Mon, 26 Jul 2021 12:17:44 +1000 Subject: [PATCH 3/3] Reduces batch size --- tide_news.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tide_news.install b/tide_news.install index d912d5a..e0a10e0 100644 --- a/tide_news.install +++ b/tide_news.install @@ -130,7 +130,7 @@ function tide_news_update_8003(&$sandbox) { $sandbox['#finished'] = $count ? 0 : 1; } - $batch_size = 100; + $batch_size = 20; $nids = \Drupal::entityQuery('node') ->condition('type', 'news') ->condition('nid', $sandbox['current'], '>')