Skip to content

Slightly decrease importance of all cron tasks #26073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
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
10 changes: 8 additions & 2 deletions app/code/Magento/Cron/Console/Command/CronCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritDoc
*/
protected function configure()
{
Expand All @@ -86,10 +86,16 @@ protected function configure()
/**
* Runs cron jobs if cron is not disabled in Magento configurations
*
* {@inheritdoc}
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
// Tasks run via cron are slightly less important than website visitors.
if (function_exists('proc_nice')) {
proc_nice(5);
}

if (!$this->deploymentConfig->get('cron/enabled', 1)) {
$output->writeln('<info>' . 'Cron is disabled. Jobs were not run.' . '</info>');
return;
Expand Down