Skip to content

Commit 8270c85

Browse files
committed
MAGETWO-52000: [Github][PR]impossible to see what is wrong with cron - unhelpful error message #3189
- fixes for QA issues.
1 parent 1c40412 commit 8270c85

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

setup/src/Magento/Setup/Model/Cron/JobFactory.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,14 @@ public function create($name, array $params = [])
134134
break;
135135
case self::JOB_ENABLE_CACHE:
136136
$cmd = $objectManager->get('Magento\Backend\Console\Command\CacheEnableCommand');
137-
return new JobSetCache($cmd, $objectManagerProvider, $multipleStreamOutput, $cronStatus, $name);
137+
return new JobSetCache(
138+
$cmd,
139+
$objectManagerProvider,
140+
$multipleStreamOutput,
141+
$cronStatus,
142+
$name,
143+
$params
144+
);
138145
break;
139146
case self::JOB_DISABLE_CACHE:
140147
$cmd = $objectManager->get('Magento\Backend\Console\Command\CacheDisableCommand');

setup/src/Magento/Setup/Model/Cron/JobSetCache.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Setup\Model\Cron;
77

8+
use Magento\Backend\Console\Command\AbstractCacheManageCommand;
89
use Symfony\Component\Console\Input\ArrayInput;
910

1011
class JobSetCache extends AbstractJob
@@ -54,8 +55,11 @@ public function __construct(
5455
public function execute()
5556
{
5657
try {
57-
$this->params['command'] = $this->command->getName();
58-
$this->command->run(new ArrayInput($this->params), $this->output);
58+
if (!empty($this->params)) {
59+
$arguments[AbstractCacheManageCommand::INPUT_KEY_TYPES] = explode(' ', $this->params[0]);
60+
}
61+
$arguments['command'] = $this->command->getName();
62+
$this->command->run(new ArrayInput($arguments), $this->output);
5963
} catch (\Exception $e) {
6064
$this->status->toggleUpdateError(true);
6165
throw new \RuntimeException(sprintf('Could not complete %s successfully: %s', $this, $e->getMessage()));

setup/src/Magento/Setup/Model/UpdaterTaskCreator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function createUpdaterTasks(array $postPayload)
142142

143143
$enabledCaches = [];
144144
foreach ($cacheStatus as $cacheName => $value) {
145-
if ($value) {
145+
if ($value === 1) {
146146
$enabledCaches[] = $cacheName;
147147
}
148148
}

0 commit comments

Comments
 (0)