diff --git a/docroot/modules/custom/va_gov_vamc/src/ServiceLocationMigration.php b/docroot/modules/custom/va_gov_vamc/src/ServiceLocationMigration.php index db2140d5ec..cc0e300bf3 100644 --- a/docroot/modules/custom/va_gov_vamc/src/ServiceLocationMigration.php +++ b/docroot/modules/custom/va_gov_vamc/src/ServiceLocationMigration.php @@ -26,13 +26,6 @@ class ServiceLocationMigration { */ protected $serviceLocation; - /** - * Counter of runs. - * - * @var int - */ - protected $runCount = 0; - /** * Constructor for ServiceLocationMigration. */ @@ -47,9 +40,6 @@ public function __construct() { * Sandbox variable for keeping state during batches. */ public function run(array &$sandbox) { - if (($this->runCount > 1) && ($this->runCount % 1000 === 0)) { - sleep(120); - } $node_storage = get_node_storage(); $nid_to_load = reset($sandbox['items_to_process']); $facility_service = (empty($nid_to_load)) ? [] : $node_storage->loadMultiple([$nid_to_load]); @@ -99,8 +89,6 @@ public function run(array &$sandbox) { unset($sandbox['items_to_process'][_va_gov_stringifynid($nid)]); - $this->runCount++; - return $status_msg; } diff --git a/scripts/content/VACMS-15559-migrate-service-location-from-node-to-paragraph.php b/scripts/content/VACMS-15559-migrate-service-location-from-node-to-paragraph.php index a6a9e49e99..41fa32a879 100644 --- a/scripts/content/VACMS-15559-migrate-service-location-from-node-to-paragraph.php +++ b/scripts/content/VACMS-15559-migrate-service-location-from-node-to-paragraph.php @@ -47,6 +47,9 @@ function va_gov_vamc_deploy_migrate_service_data_to_service_location(&$sandbox) script_library_sandbox_init($sandbox, 'get_nids_of_type', [$source_bundle, FALSE]); $migrator = new ServiceLocationMigration(); $msg = $migrator->run($sandbox); + if ($sandbox['current'] > 1 && $sandbox['current'] % 1000 === 0) { + sleep(150); + } $new_service_locations = $sandbox['service_locations_created_count'] ?? 0; $updated_service_locations = $sandbox['service_locations_updated_count'] ?? 0; $forward_revisions = $sandbox['forward_revisions_count'] ?? 0;