This article provides a patch for a known Adobe Commerce 2.2.2 issue related to having multiple cron jobs scheduled to run at the same time after the time variables for certain tasks were edited in the Commerce Admin.
When cron is configured to run every minute, if you edit time variables for three scheduled tasks in Admin, the
cron_schedule database table shows groups of multiple tasks scheduled to run at the same time.
Steps to reproduce:
In Commerce Admin, navigate to Stores > Settings > Configuration > ADVANCED > System > Cron (Scheduled Tasks) > Cron configuration options for group: default.
Configure the following options:
Click Save Config.
In SSH, run the
crontab -e command.
Set cron to run every minute.
Open three terminal tabs/windows.
Go to the Adobe Commerce
root/base/project directory in each terminal window.
Run the following command in each tab/window:
bin/magento cache:flush && bin/magento cron:run && bin/magento cache:flush && bin/magento cron:run
Go to MySQL and run the following query:
SELECT job_code, scheduled_at, count as count FROM cron_schedule GROUP BY job_code, scheduled_at HAVING count > 1 ORDER BY scheduled_at;
See groups of tasks scheduled to run at the same time.
Expected result: One cron
job_code should be scheduled for the certain time period.
Actual result: There are multiple cron jobs scheduled for the same time period.
For Adobe Commerce on cloud infrastructure merchants, updating the ECE-tools will solve the issue.
Adobe Commerce on-premises merchants should apply one of the attached patches to solve the issue.
The patches are attached to this article. To download, scroll down to the end of the article and click the file name, or click one the following link:
The patches were created for particular version noted in the patch file name. For example, MDVA-11304_EE_2.2.4_COMPOSER_v1.patch was created for Adobe Commerce 2.2.4 and is the best patch to be used for this version.
The patches are also compatible with the following versions:
See How to apply a composer patch provided by Adobe Commerce in our support knowledge base, for instructions.