Skip to content

Commit 75a3c2a

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 bdaf001 commit 75a3c2a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Diff for: setup/src/Magento/Setup/Model/Cron/JobSetCache.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public function __construct(
5454
public function execute()
5555
{
5656
try {
57-
$this->command->run(new ArrayInput(['command' => $this->command->getName()]), $this->output);
57+
$this->params['command'] = $this->command->getName();
58+
$this->command->run(new ArrayInput($this->params), $this->output);
5859
} catch (\Exception $e) {
5960
$this->status->toggleUpdateError(true);
6061
throw new \RuntimeException(sprintf('Could not complete %s successfully: %s', $this, $e->getMessage()));

Diff for: setup/src/Magento/Setup/Model/UpdaterTaskCreator.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,6 @@ public function createUpdaterTasks(array $postPayload)
138138
\Magento\Setup\Model\Cron\JobFactory::JOB_UPGRADE,
139139
[]
140140
);
141-
} elseif ($jobType == 'disable') {
142-
$errorMessage .= $this->updater->createUpdaterTask(
143-
[],
144-
\Magento\Setup\Model\Updater::TASK_TYPE_MAINTENANCE_MODE,
145-
['enable' => false]
146-
);
147141
}
148142

149143
$enabledCaches = [];
@@ -161,6 +155,14 @@ public function createUpdaterTasks(array $postPayload)
161155
);
162156
}
163157

158+
if ($jobType == 'disable') {
159+
$errorMessage .= $this->updater->createUpdaterTask(
160+
[],
161+
\Magento\Setup\Model\Updater::TASK_TYPE_MAINTENANCE_MODE,
162+
['enable' => false]
163+
);
164+
}
165+
164166
return $errorMessage;
165167
}
166168

0 commit comments

Comments
 (0)