Skip to content

[Issue] Add --exclude-group to cron:run #36628

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
3 of 5 tasks
m2-assistant bot opened this issue Dec 16, 2022 · 2 comments · Fixed by #34117
Closed
3 of 5 tasks

[Issue] Add --exclude-group to cron:run #36628

m2-assistant bot opened this issue Dec 16, 2022 · 2 comments · Fixed by #34117
Assignees
Labels
Area: Framework Component: Cron Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@m2-assistant
Copy link

m2-assistant bot commented Dec 16, 2022

This issue is automatically created based on existing pull request: #34117: Add --exclude-group to cron:run


Description

https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-group-run

When you decide to split a single cron group with the --group flag it means you need to do so for every group in your instance.

It's pretty common for third party modules to define their own groups whenever they like, so we have to keep up to date with the defined groups in the instance to keep adding these to our crontab when new groups are added.

One of my instances currently has 11 groups to manage, more will come in the future and its just something I need to mentally keep an eye on, a bit annoying.

In my case I only really want to run the crons like

* * * * * bin/magento cron:run --exclude-group index
* * * * * flock -n index.lock bin/magento cron:run --group index

This will give me better granular control over the indexer crons which can be useful when your store reaches hundreds of thousands of SKUs. Any other random cron groups would then still be able to run by default like in normal operation.

For future proofing I've made the --exclude-group flag stackable so you can define it multiple times like

* * * * * bin/magento cron:run --exclude-group index --exclude-group consumers

Manual testing scenarios (*)

  1. Run cron with no params, all groups run
  2. Run cron with --group, only that group runs
  3. Run cron with --group and that group also in --exclude-group, no groups run
  4. Run cron with --exclude-group, that group is excluded
  5. Run cron with multiple --exclude-group, all defined groups are excluded

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
@m2-assistant m2-assistant bot added Component: Cron Priority: P3 May be fixed according to the position in the backlog. labels Dec 16, 2022
@engcom-Lima engcom-Lima added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Reported on 2.4.x Indicates original Magento version for the Issue report. Area: Framework labels Dec 16, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-7449 is successfully created for this GitHub issue.

@m2-assistant
Copy link
Author

m2-assistant bot commented Dec 16, 2022

✅ Confirmed by @engcom-Lima. Thank you for verifying the issue.
Issue Available: @engcom-Lima, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Component: Cron Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants