Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions app/code/Magento/Deploy/Process/Queue.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2017 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

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

/**
* Default max execution time
*/
const DEFAULT_MAX_EXEC_TIME = 900;
public const DEFAULT_MAX_EXEC_TIME = 900;

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