diff --git a/src/MigrateBatchExecutable.php b/src/MigrateBatchExecutable.php index 2f82639..de268a2 100644 --- a/src/MigrateBatchExecutable.php +++ b/src/MigrateBatchExecutable.php @@ -279,6 +279,11 @@ public function processBatch(&$context) { try { $context['finished'] = $sandbox['current'] / $sandbox['total']; + // call hasTime() once at the begining to start the timer and set the timer threshold. + // If we don't then it won't get called until after the first record is processed and the + // algorithm won't consider the time it spent on the first record. Large file ingests + // will hit a php max exec timeout then. + static::hasTime(); while ($context['finished'] < 1) { $item = $this->queue->claimItem(); if (!$item) {