aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/BackgroundJob
Commit message (Collapse)AuthorAgeFilesLines
* fix(cron): Keep job class limitation when searching for the next jobbackport/50896/stable31Joas Schilling2025-02-191-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix: log a warning when we can't build a background jobjoblist-build-error-logRobin Appelman2024-10-161-0/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix: Use sha256 to hash arguments of background jobsLouis Chemineau2024-09-051-5/+4
| | | | | | This is to prevent collision as we are sometime hashing user input, yet using that hash to target the background job in the database. Signed-off-by: Louis Chemineau <louis@chmn.me>
* Merge pull request #47155 from nextcloud/executeStatementOnDeleteJohn Molakvoæ2024-09-041-37/+16
|\
| * fix: lintGit'Fellow2024-08-091-1/+1
| | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
| * fix(jobs): Swicth to executeStatement() while deleting rowsGit'Fellow2024-08-091-37/+16
| | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* | style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-3/+3
|/ | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* fix(db): Deprecate `IExpressionBuilder::or()` and ↵Joas Schilling2024-07-191-4/+4
| | | | | | `IExpressionBuilder::and()` without parameters Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(db): Promote the use of `getDatabaseProvider` to reduce the impage of ↵Joas Schilling2024-07-191-2/+1
| | | | | | removed upstream platforms Signed-off-by: Joas Schilling <coding@schilljs.com>
* feat(files_sharing): implement IShareProviderWithNotification and refactor ↵skjnldsv2024-07-121-1/+1
| | | | | | sendMailNotification Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
* fix: delete background jobs by id when cleaning upRobin Appelman2024-05-301-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-26/+4
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix(bg-jobs): review adjustmentsJulien Veyssier2024-05-021-2/+1
| | | | Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
* feat(bg-jobs): allow setting a job class list instead of a single class in ↵Julien Veyssier2024-05-021-5/+9
| | | | | | cron.php and the job worker occ command Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
* fix(bg-jobs): fix psalm issuesMarcel Klehr2024-05-021-1/+4
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* fix(bg-jobs): fix minor issuesMarcel Klehr2024-05-021-1/+1
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* feat(bg-jobs): Add background worker occ commandJulius Härtl2024-05-021-0/+19
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* feat(bg-jobs): Allow calling cron.php with a background job classJulius Härtl2024-05-021-3/+7
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-021-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #43387 from nextcloud/fix/migrate-away-from-ilogger-in-jobsCôme Chilliet2024-02-083-210/+0
|
* Revert "Merge branch 'master' of github.com:nextcloud/server"Louis Chemineau2024-02-083-0/+210
| | | | | This reverts commit d9d60238c7aaab9c61bf2d50c15aa59bc88c8975, reversing changes made to ba3fdb0cdcfbb84f0080a2146a4ba2f01569915d.
* chore: Delete deprecated internal Job classesCôme Chilliet2024-02-083-210/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(cron): Reset the reserved_at when force executing from CLIJoas Schilling2023-12-201-0/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(joblist): also reset last_run timestamp on updating an existing jobAnna Larch2023-12-151-0/+1
| | | | Signed-off-by: Anna Larch <anna@nextcloud.com>
* fix(JobList#hasReservedJob): Break tie when multiple jobs are reservedMarcel Klehr2023-11-061-1/+1
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* feat(backgroundjob): Schedule job after <timestamp>Christoph Wurst2023-09-291-7/+14
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix ParallelAwareJob testsMarcel Klehr2023-07-281-9/+23
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* Remove job from oc_jobs when the file is not findableLouis Chemineau2023-05-031-1/+2
| | | | | | When an application is disabled, or when a background jobs is removed by the app developer, then the job won't be found. In those cases, it makes sense to remove those jobs from oc_job. Signed-off-by: Louis Chemineau <louis@chmn.me>
* JobList: add debug log when hasReservedJob query failsMarcel Klehr2023-04-241-1/+5
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* JobList#hasReservedJobs: Close cursorMarcel Klehr2023-04-231-1/+3
| | | | | | so Joas doesn't die Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* Fix BackgroundJob testsMarcel Klehr2023-04-231-1/+2
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* Update lib/private/BackgroundJob/JobList.phpMarcel Klehr2023-04-231-1/+2
| | | | Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* test(BackgroundJobs): Add tests for allowParallelRuns and hasReservedJobsMarcel Klehr2023-04-231-1/+1
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* feat(BackgroundJobs): Allow preventing parallel runs for a job classMarcel Klehr2023-04-231-0/+18
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* Fix API breakage by using a new method insteadCôme Chilliet2023-01-121-1/+10
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Remove deprecated method getAll instead of breaking API on deprecated methodCôme Chilliet2023-01-121-11/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Use a Generator for job list to fix background-job:list commandCôme Chilliet2023-01-101-9/+11
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix many tests and warningsCarl Schwan2022-08-082-79/+0
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Port existing server code to new interfaceCarl Schwan2022-08-083-2/+6
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix typing in IJobListCôme Chilliet2022-07-111-8/+4
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Code cleaning of Background/ListCommandCôme Chilliet2022-07-111-3/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Add command to list jobsCôme Chilliet2022-07-111-1/+17
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Clean up JobList classCôme Chilliet2022-07-111-52/+26
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Check background job typeChristoph Wurst2022-05-311-0/+4
| | | | | | | | | | | It is assumed that a job class loaded from the jobs table is an IJob, but due to programming error the job might be of another type. Then the setters will most likely fail. This patch adds an interface type check so only correct jobs are used, anything else is ignored. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Get not only time-sensitive next job from list but anyKirill Popov2022-04-241-1/+1
| | | | | | | Before the change webcron used to select **only** time-sensitive tasks. Signed-off-by: Kirill Popov <kirill.s.popov@gmail.com>
* Do chuncked job deletionCarl Schwan2022-03-171-1/+17
| | | | | | | | | | | | | | | This is helpful in cases where we are deleting tons jobs at the same time in a gallera cluster. This doesn't happen often but this can create issues. Test plan: 1. Use https://github.com/nextcloud/quota_warning/pull/88 2. Change max to 1 3. Enabled/Disable quota_warning app and see jobs getting sucessfully added and removed Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Also use hashed/indexed column on deleteJoas Schilling2022-03-021-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Deprecate our old, internal background job base classesChristoph Wurst2022-02-225-0/+13
| | | | | | | The OCP ones should be used instead. This makes it more visible in our IDEs that the base class of background job should be replaced. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Allow apps to specify if their background job can be delayedJoas Schilling2022-02-071-3/+14
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>