Skip to content

Commit e77e018

Browse files
extract queue length variable (WP-948)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4845194 commit e77e018

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

inc/Smartling/Jobs/DownloadTranslationJob.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function run(string $source): void
4545
private function processDownloadQueue(int $blogId): void
4646
{
4747
$processed = 0;
48-
while ($processed++ < ($this->queue->stats()[QueueInterface::QUEUE_NAME_DOWNLOAD_QUEUE] ?? 0)) {
48+
$queueLength = $this->queue->stats()[QueueInterface::QUEUE_NAME_DOWNLOAD_QUEUE] ?? 0;
49+
while ($processed++ < $queueLength) {
4950
$queueItem = $this->queue->dequeue(QueueInterface::QUEUE_NAME_DOWNLOAD_QUEUE);
5051
if ($queueItem === null) {
5152
break;

0 commit comments

Comments
 (0)