-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Edit Cron Group of Individual Job #151
Comments
Oh my goodness, 1000% this |
Yes would be a big plus |
Ooo interesting. I might pick this one up. |
Here's one approach, that does it through adding another config; https://github.com/AydinHassan/m2-cron-job-modify/tree/master It uses a plugin on the Magento cron config class; <type name="Magento\Cron\Model\Config">
<plugin disabled="false" name="modify_cron_jobs" type="TrashPanda\CronJobModifier\Plugin\ModifyCronJobs"/>
</type> There it has a an afterGetJobs function; public function afterGetJobs(Config $subject, array $jobs): array
{
$jobs = $this->moveJobGroups($jobs);
return $jobs;
} And the function that moves the cron job to another group; private function moveJobGroups(array $jobs): array
{
foreach ($jobs as $group => $groupJobs) {
$moves = $this->config->getJobsToMoveForGroup($group);
foreach ($moves as $job => $destinationGroup) {
if (isset($jobs[$destinationGroup]) && isset($groupJobs[$job])) {
$jobs[$destinationGroup][$job] = $groupJobs[$job];
unset($jobs[$group][$job]);
}
}
}
return $jobs;
} We could do something similar, by adding a dropdown to the |
@fredden any thoughts? |
It would be great to have the ability to move a job to another cron group the same way you can edit an individual cron's schedule. Many 3rd party modules carelessly add their long running crons to the default or index group resulting in important lightweight jobs getting missed. Magento doesn't seem to have a clean way to move jobs to other groups so adding this feature would be a huge win in my opinion.
The text was updated successfully, but these errors were encountered: