Skip to content

Commit 19eb0b8

Browse files
committed
Merge remote-tracking branch '39954/patch-3' into commpr-10131-1706
2 parents 4f82be7 + 315547d commit 19eb0b8

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

app/code/Magento/Deploy/Process/Queue.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2017 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -24,12 +24,12 @@ class Queue
2424
/**
2525
* Default max amount of processes
2626
*/
27-
const DEFAULT_MAX_PROCESSES_AMOUNT = 4;
27+
public const DEFAULT_MAX_PROCESSES_AMOUNT = 4;
2828

2929
/**
3030
* Default max execution time
3131
*/
32-
const DEFAULT_MAX_EXEC_TIME = 900;
32+
public const DEFAULT_MAX_EXEC_TIME = 900;
3333

3434
/**
3535
* @var array
@@ -263,6 +263,15 @@ private function executePackage(Package $package, string $name, array &$packages
263263
&& !$this->isDeployed($package)
264264
&& ($this->maxProcesses < 2 || (count($this->inProgress) < $this->maxProcesses))
265265
) {
266+
//Prevents duplicate execution of a theme package by checking if it has already been scheduled.
267+
if (!isset($packages[$name])) {
268+
$this->logger->debug(sprintf(
269+
'Preventing duplicate execution of package as it is in progress: %s (pid: %s)',
270+
$package->getPath(),
271+
$this->getPid($package)
272+
));
273+
return;
274+
}
266275
unset($packages[$name]);
267276
$this->execute($package);
268277
}

0 commit comments

Comments
 (0)