$context['sandbox'
]['max'
] =
$this->updateProcessor->
numberOfQueueItems();
$context['sandbox'
]['progress'
] = 0;
$context['message'
] =
$this->
t('Checking available update data ...'
);
$context['results'
]['updated'
] = 0;
$context['results'
]['failures'
] = 0;
$context['results'
]['processed'
] = 0;
} // Grab another item from the fetch queue.
for ($i = 0;
$i < 5;
$i++
) { if ($item =
$this->updateProcessor->
claimQueueItem()) { if ($this->updateProcessor->
processFetchTask($item->data
)) { $context['results'
]['updated'
]++;
$context['message'
] =
$this->
t('Checked available update data for %title.',
['%title' =>
$item->data
['info'
]['name'
]]);
} else { $context['message'
] =
$this->
t('Failed to check available update data for %title.',
['%title' =>
$item->data
['info'
]['name'
]]);
$context['results'
]['failures'
]++;
} $context['sandbox'
]['progress'
]++;
$context['results'
]['processed'
]++;
$context['finished'
] =
$context['sandbox'
]['progress'
] /
$context['sandbox'
]['max'
];
$this->updateProcessor->
deleteQueueItem($item);
}