diff --git a/server/hedley/modules/custom/hedley_admin/scripts/bump-revisions-for-content-type.php b/server/hedley/modules/custom/hedley_admin/scripts/bump-revisions-for-content-type.php index 0228b51f0c..d1aa5b0f35 100644 --- a/server/hedley/modules/custom/hedley_admin/scripts/bump-revisions-for-content-type.php +++ b/server/hedley/modules/custom/hedley_admin/scripts/bump-revisions-for-content-type.php @@ -45,6 +45,7 @@ drush_print("$count nodes of type $type located."); +$processed = 0; while (TRUE) { // Free up memory. drupal_static_reset(); @@ -70,6 +71,14 @@ } $nid = end($ids); + $processed += count($nodes); + + // Explicitly unset large variables after use for memory optimization. + unset($nodes); + + if ($processed % 5000 == 0) { + drush_print("Processed $processed out of $count."); + } if (round(memory_get_usage() / 1048576) >= $memory_limit) { drush_print(dt('Stopped before out of memory. Start process from the node ID @nid', ['@nid' => $nid]));