Skip to content

Commit

Permalink
Fixes a bug where the timer was not started soon enough.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bethany Seeger committed Oct 14, 2021
1 parent 56ffef6 commit a86d8b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/MigrateBatchExecutable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a86d8b4

Please sign in to comment.