Allow calling cron jobs background job class with occ#30359
Merged
marcelklehr merged 12 commits intomasterfrom May 6, 2024
Merged
Allow calling cron jobs background job class with occ#30359marcelklehr merged 12 commits intomasterfrom
marcelklehr merged 12 commits intomasterfrom
Conversation
Member
Author
|
Might be something related to #29204 to have also an occ command to run individual job classes in addition to the list. This would be similar to how Laravel handles queues https://laravel.com/docs/8.x/queues some further things to think about:
|
Member
|
This can also help in this cases: #30273 |
Merged
Merged
Member
|
we already have background-job:execute but I heard it doesn't work for all types and requires a job id, not a class name |
Member
Author
|
Sounds like a good idea to rather implement it as an occ which people could still setup as a cron job then. |
f4735c9 to
fa4a716
Compare
fa4a716 to
d6a4f4f
Compare
CarlSchwan
approved these changes
Sep 5, 2022
come-nc
reviewed
Sep 5, 2022
come-nc
reviewed
Sep 5, 2022
core/Command/Background/Worker.php
Outdated
Comment on lines
98
to
100
| if ((int)$row['count'] === 1) { | ||
| $count++; | ||
| } else { |
f24e031 to
7f39075
Compare
Member
|
Still stale @julien-nc ? |
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
…ss in cron.php and the job worker occ command Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
…und-job:worker for the job class list Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
7f39075 to
0eb4cdd
Compare
marcelklehr
approved these changes
May 3, 2024
come-nc
approved these changes
May 6, 2024
Member
Author
|
Thanks @marcelklehr and @julien-nc for picking this one up. 🚀 |
| * @return list<array{class:class-string, count:int}> | ||
| * @since 30.0.0 | ||
| */ | ||
| public function countByClass(): array; |
Member
There was a problem hiding this comment.
Merged
This was referenced Jun 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This would allow important jobs to be handled in a separate cronjob execution, so they can get executed, even if other jobs have lined up before
e.g. have a separate cron job with
php occ background-job:worker OCA\\Files\\BackgroundJob\\ScanFiles