Problem/Motivation
While adding new cron tasks for different sites, normally the code gets sent to different environments and everything needs to be automated, so a drush command to discover new jobs would come in handy, so far normally I just clicked the "Discover jobs" button, but that adds a manual step.
By now I get by just with this drush command:
drush php-eval "\Drupal::service('ultimate_cron.discovery')->discoverCronJobs();"
Proposed resolution
But would be nice to have something specific for the module or maybe an argument for some of the already existing commands to include it, for example executing something like:
drush cron-list --discover-jobs
If that sounds something we could agree on I could create a patch for that.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3097096-11.patch | 2.08 KB | angel.h |
Comments
Comment #2
prudloff commentedWe would also be interested in a patch that does this.
It would feel cleaner than having to call
php-eval.Comment #3
prudloff commentedThe attached patch adds a new
drush cron-discovercommand.Comment #4
tunicPatch works ok, the command is available and runs withouts issues.
Comment #5
berdirDoesn't apply anymore.
Comment #6
chandreshgiri gauswami commentedRe-rolled patch.
Comment #7
tunicTested and working ok, command is available and works without issues.
Comment #8
berdirConflicts on constructor changes that I had to commit for drush 13 compatibility.
That said, I also just committed #3317033: discover cron jobs on cache rebuild rather than module install?, so I'm not sure if this is still needed, you can just clear caches now.
Comment #9
prudloff commentedIndeed, discovering when rebuilding the cache would be enough for our use case.
Comment #10
prudloff commentedComment #11
angel.hI have created a patch specific for 2.0alpha7 (not alpha8) to comply with PHP 8.2 and 8.3 since dynamic declarations of properties is deprecated in PHP8.2.
Comment #12
dieterholvoet commented