Commit Graph

86 Commits (jtr/fix-public-exceptions-http-codes)

Author SHA1 Message Date
Joas Schilling 031d739d33
fix(cron): Fix infinite loop on ParallelAware blocked jobs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-07-25 15:28:24 +07:00
Christoph Wurst 2395526e6c
perf(cron): Delay (re)checking timed jobs
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2025-03-31 13:21:29 +07:00
Joas Schilling 73d94353d1
fix(cron): Keep job class limitation when searching for the next job
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-02-19 08:44:33 +07:00
Robin Appelman 0741373f94
fix: log a warning when we can't build a background job
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-10-16 15:29:25 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Louis Chemineau 843a47f12c
fix: Use sha256 to hash arguments of background jobs
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>
2024-09-05 15:36:51 +07:00
John Molakvoæ 8f825cbd16
Merge pull request #47155 from nextcloud/executeStatementOnDelete 2024-09-04 09:35:16 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Git'Fellow 2156a927a3
fix: lint
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-08-09 22:47:32 +07:00
Git'Fellow c6be80a75d
fix(jobs): Swicth to executeStatement() while deleting rows
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-08-09 22:38:33 +07:00
Joas Schilling eeb6ddb176
fix(db): Deprecate `IExpressionBuilder::or()` and `IExpressionBuilder::and()` without parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:16 +07:00
Joas Schilling 829f2b9bc7
fix(db): Promote the use of `getDatabaseProvider` to reduce the impage of removed upstream platforms
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:14 +07:00
skjnldsv d388370c3b feat(files_sharing): implement IShareProviderWithNotification and refactor sendMailNotification
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2024-07-12 20:14:30 +07:00
Robin Appelman 1a9f7d5348
fix: delete background jobs by id when cleaning up
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-05-30 15:07:26 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Julien Veyssier d967151f52
fix(bg-jobs): review adjustments
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2024-05-02 16:43:42 +07:00
Julien Veyssier 1acc57b5c0
feat(bg-jobs): allow setting a job class list instead of a single class in cron.php and the job worker occ command
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2024-05-02 16:43:41 +07:00
Marcel Klehr 352d79deee
fix(bg-jobs): fix psalm issues
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2024-05-02 16:43:41 +07:00
Marcel Klehr a3d8632fbe
fix(bg-jobs): fix minor issues
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2024-05-02 16:43:41 +07:00
Julius Härtl 8400bfee01
feat(bg-jobs): Add background worker occ command
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-05-02 16:43:41 +07:00
Julius Härtl 52eb6d8726
feat(bg-jobs): Allow calling cron.php with a background job class
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-05-02 16:43:40 +07:00
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +07:00
Côme Chilliet 303e2febc7
Merge pull request #43387 from nextcloud/fix/migrate-away-from-ilogger-in-jobs 2024-02-08 18:27:44 +07:00
Louis Chemineau 898df41de9
Revert "Merge branch 'master' of github.com:nextcloud/server"
This reverts commit d9d60238c7, reversing
changes made to ba3fdb0cdc.
2024-02-08 15:31:19 +07:00
Côme Chilliet e78e27187a chore: Delete deprecated internal Job classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-08 10:28:29 +07:00
Joas Schilling 4cb5501a3f
fix(cron): Reset the reserved_at when force executing from CLI
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-12-20 10:07:41 +07:00
Anna Larch dc87c531b5 fix(joblist): also reset last_run timestamp on updating an existing job
Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-12-15 11:49:51 +07:00
Marcel Klehr cbd304c8f0 fix(JobList#hasReservedJob): Break tie when multiple jobs are reserved
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-11-06 10:47:40 +07:00
Christoph Wurst 04ecc2a6a9
feat(backgroundjob): Schedule job after <timestamp>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-09-29 10:29:40 +07:00
Marcel Klehr 9f4b3de03c Fix ParallelAwareJob tests
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-07-28 11:12:32 +07:00
Louis Chemineau 8ad2f34045 Remove job from oc_jobs when the file is not findable
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>
2023-05-03 10:39:38 +07:00
Marcel Klehr 524d053eb2 JobList: add debug log when hasReservedJob query fails
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-04-24 17:16:32 +07:00
Marcel Klehr 5a7f023bfc JobList#hasReservedJobs: Close cursor
so Joas doesn't die

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-04-23 12:36:12 +07:00
Marcel Klehr 5608b50778 Fix BackgroundJob tests
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-04-23 12:36:12 +07:00
Marcel Klehr 6f9a3218d0 Update lib/private/BackgroundJob/JobList.php
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-04-23 12:36:12 +07:00
Marcel Klehr 1296f3612e test(BackgroundJobs): Add tests for allowParallelRuns and hasReservedJobs
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-04-23 12:36:12 +07:00
Marcel Klehr c01c516323 feat(BackgroundJobs): Allow preventing parallel runs for a job class
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-04-23 12:36:12 +07:00
Côme Chilliet d74044f634
Fix API breakage by using a new method instead
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-12 17:18:59 +07:00
Côme Chilliet e74f464662
Remove deprecated method getAll instead of breaking API on deprecated method
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-12 17:13:08 +07:00
Côme Chilliet 679682c186
Use a Generator for job list to fix background-job:list command
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-10 18:20:31 +07:00
Carl Schwan 49334e4d9c
Fix many tests and warnings
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-08 17:03:51 +07:00
Carl Schwan 48d9c4d2b0
Port existing server code to new interface
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-08 17:03:19 +07:00
Côme Chilliet 2e921f8b3d Fix typing in IJobList
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-11 09:46:23 +07:00
Côme Chilliet 868d748dbf Code cleaning of Background/ListCommand
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-11 09:46:23 +07:00
Côme Chilliet 3d01179907 Add command to list jobs
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-11 09:46:23 +07:00
Côme Chilliet 0b7779b6ff Clean up JobList class
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-11 09:46:22 +07:00
Christoph Wurst b17c4a6072 Check background job type
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>
2022-05-31 15:24:30 +07:00
Kirill Popov 0b27b9e658 Get not only time-sensitive next job from list but any
Before the change webcron used to select
**only** time-sensitive tasks.

Signed-off-by: Kirill Popov <kirill.s.popov@gmail.com>
2022-04-24 21:55:53 +07:00
Carl Schwan c870bd1968 Do chuncked job deletion
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>
2022-03-17 21:41:58 +07:00
Joas Schilling abcf45e336
Also use hashed/indexed column on delete
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-02 09:23:16 +07:00