Skip to content

Commit 08088d2

Browse files
committed
MAGETWO-52000: [Github][PR]impossible to see what is wrong with cron - unhelpful error message #3189
- updating job set cache
1 parent 96584ae commit 08088d2

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,20 @@ public function execute()
6363
$arguments[AbstractCacheManageCommand::INPUT_KEY_TYPES] = explode(' ', $this->params[0]);
6464
}
6565
$arguments['command'] = 'cache:enable';
66-
$definition = new InputDefinition([
67-
new InputArgument(AbstractCacheManageCommand::INPUT_KEY_TYPES, InputArgument::REQUIRED),
68-
new InputArgument('command', InputArgument::REQUIRED),
69-
]);
70-
71-
$this->command->setDefinition($definition);
66+
$inputDefinition = [];
67+
if ($this->command->getDefinition()->hasArgument('command')) {
68+
$inputDefinition[] = new InputArgument('command', InputArgument::REQUIRED);
69+
}
70+
if ($this->command->getDefinition()->hasArgument(AbstractCacheManageCommand::INPUT_KEY_TYPES)) {
71+
$inputDefinition[] = new InputArgument(
72+
AbstractCacheManageCommand::INPUT_KEY_TYPES,
73+
InputArgument::REQUIRED
74+
);
75+
}
76+
if (!empty($inputDefinition)) {
77+
$definition = new InputDefinition($inputDefinition);
78+
$this->command->setDefinition($definition);
79+
}
7280
} else {
7381
$arguments['command'] = 'cache:disable';
7482
}

0 commit comments

Comments
 (0)