summaryrefslogtreecommitdiffstats
path: root/lib/private/BackgroundJob/JobList.php
Commit message (Collapse)AuthorAgeFilesLines
* fix(JobList#hasReservedJob): Break tie when multiple jobs are reservedMarcel Klehr2023-11-091-1/+1
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* 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 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>
* Allow apps to specify if their background job can be delayedJoas Schilling2022-02-071-3/+14
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add hashed attribute column for indexed job existence checkJulius Härtl2022-01-181-2/+3
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Check style updateCarl Schwan2022-01-131-2/+2
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Reset job disabling timer on adding the job againJulius Härtl2022-01-031-13/+19
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Bump since versionJoas Schilling2021-10-141-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Move queries to the joblistJoas Schilling2021-10-141-4/+29
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-1/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove @suppress SqlInjectionCheckerMorris Jobke2020-09-161-2/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove getLastJob from IJobListMorris Jobke2020-08-131-12/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* JobList: Typecast last_run to integerGeorg Ehrke2020-01-301-1/+1
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* Update license headersChristoph Wurst2019-12-051-1/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-221-1/+1
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix integer background job id type errorChristoph Wurst2019-01-151-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Revert "Wait for cron to finish before running upgrade command"Morris Jobke2018-11-011-39/+1
| | | | | | This reverts commit 18e9631810ad1d3d72c2b4bbee330169808108ad. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Suppress potential SQL injection warning as they are false positivesMorris Jobke2018-07-091-0/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Unlock failed cron jobs and set a high "last_checked" value to avoid ↵Morris Jobke2018-07-091-0/+9
| | | | | | | | | continous re-check * fixes issue where cronjobs of a not-loaded app are marked as "still running" because there is a "reserved_at" value stored * fixed #9992 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Wait for cron to finish before running upgrade commandMorris Jobke2018-06-191-1/+39
| | | | | | * fixes #9562 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headersMorris Jobke2017-11-061-0/+3
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Add Phan plugin to check for SQL injectionsLukas Reschke2017-07-201-0/+1
| | | | | | | | | | This adds a phan plugin which checks for SQL injections on code using our QueryBuilder, while it isn't perfect it should already catch most potential issues. As always, static analysis will sometimes have false positives and this is also here the case. So in some cases the analyzer just doesn't know if something is potential user input or not, thus I had to add some `@suppress SqlInjectionChecker` in front of those potential injections. The Phan plugin hasn't the most awesome code but it works and I also added a file with test cases. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Add duration of last job execution to the tableNoveen Sachdeva2017-04-251-3/+15
|
* make JobList::next() lock freeJörn Friedrich Dreyer2017-04-071-5/+10
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update with robinJoas Schilling2016-07-211-1/+1
|
* Fix othersJoas Schilling2016-07-211-2/+3
|
* Lock jobs while executing them, to allow multiple executors to run in parallelJoas Schilling2016-05-211-33/+53
|
* Move \OC\BackgroundJob to PSR-4Roeland Jago Douma2016-04-261-0/+294