try { $details =
$this->
getQueue()->
pop($queueId,
$this->
getConfig()->
getByNamespace('SwagMultiEdit', 'batchItemsPerRequest', 512
));
if (!
empty($details)) { $this->
updateDetails($details,
$operations);
$connection->
commit();
} } catch (Exception
$e) { $connection->
rollBack();
throw new RuntimeException(sprintf('Error updating details: %s',
$e->
getMessage()), 0,
$e);
} $remaining =
$queue->
getArticleDetails()->
count();
if ($remaining === 0
) { $entityManager->
remove($queue);
$entityManager->
flush();
} return [ 'totalCount' =>
$queue->
getInitialSize(),
'remaining' =>
$remaining,
'done' =>
$remaining === 0,
'processed' =>
$queue->
getInitialSize() -
$remaining,
];