aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/BackgroundJob
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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-046-6/+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>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-242-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove getLastJob from IJobListMorris Jobke2020-08-131-12/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use formal type hints instead of informal PHPDocMorris Jobke2020-07-061-16/+6
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix wrong phpdoc for execute methodDaniel Kesselberg2020-07-032-2/+4
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Update license headers for 19Christoph Wurst2020-04-292-0/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-092-0/+2
| | | | | | For PSR2 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-313-0/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make sure to catch php errors during job executionDaniel Kesselberg2020-01-311-1/+1
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* JobList: Typecast last_run to integerGeorg Ehrke2020-01-301-1/+1
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* Update license headersChristoph Wurst2019-12-056-6/+8
| | | | 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-064-0/+7
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Add |null to PHPDocLukas Reschke2017-08-013-3/+3
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>