Commit graph

134 commits

Author SHA1 Message Date
Ferdinand Thiessen
d6d6747a73 refactor: apply rector rules for PHPUnit 10
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-10-27 21:56:04 +01:00
Carl Schwan
9d7fbb1b86 refactor: Move cron setup to a service
This will allow in the future the following things:

- Create unit tests for it
- Make cron.php a occ command
- Make webcron a proper controller

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 15:28:43 +02:00
Ferdinand Thiessen
89896b1d89
chore: Remove deprecated IJob::execute method
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-04 17:48:26 +02:00
provokateurin
6d6d83d3d9
refactor: Extend rector to all top-level files
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-05-15 10:30:02 +02:00
Joas Schilling
72e3e13ac4
fix(cron): Ignore time sensitivity when a class was explicitely scheduled
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-02-21 10:45:40 +01: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 +02:00
John Molakvoæ (skjnldsv)
9538c0ce7e
feat: add verbose mode to cron.php
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2024-09-15 16:04:43 +02: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 +02:00
Christoph Wurst
2b38d6ae7e
fix(session): Log when session_* calls are slow
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-08-07 09:02:10 +02:00
Josh
ecef392231
Merge branch 'master' into jtr/fix-cron-memory-usage-levels
Signed-off-by: Josh <josh.t.richards@gmail.com>
2024-06-12 16:57:21 -04:00
Christoph Wurst
7ea6eac743
fix(cron): Log long running jobs
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-06-12 09:57:08 +02:00
Josh
8ee070cce5
fix(cron): Log excess memory usage at debug and info levels
Signed-off-by: Josh <josh.t.richards@gmail.com>
2024-06-11 14:20:57 +02:00
Julien Veyssier
c39c0ab46d
fix(cron): avoid accessing unset argv index
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2024-06-06 15:30:16 +02:00
Andy Scherzinger
5c49a54801
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-26 20:05:04 +02:00
Simon L.
88648fa493 Revert: "Check datadirectory owner, not config owner."
Signed-off-by: Simon L <szaimen@e.mail.de>
2024-05-14 12:09:15 +02:00
Julien Veyssier
0eb4cddc54
feat(bg-jobs): support multiple arguments in cron.php and occ:background-job:worker for the job class list
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2024-05-02 16:43:42 +02: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 +02:00
Julien Veyssier
9814bffb77
chore(bg-jobs): add -h help option to cron.php
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2024-05-02 16:43:41 +02: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 +02:00
Herman van Rink
164c05e40b
fix: Cron misrepresenting itself as console
Signed-off-by: Herman van Rink <rink@initfour.nl>
2024-03-13 11:05:23 +01:00
Côme Chilliet
65bad47e7e
fix: Suppress psalm errors about deprecated execute method, we have to use it for now
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-03-12 11:23:35 +01:00
Côme Chilliet
75751d51de
fix: Call execute until it is removed for Job class
Because if an application extends execute it will change behavior
 without warning otherwise.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-03-12 11:01:46 +01:00
Sam Bull
ae3b9cce99 feat: check datadirectory owner instead of config.php owner
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2024-02-28 14:20:30 +01:00
Côme Chilliet
303e2febc7
Merge pull request #43387 from nextcloud/fix/migrate-away-from-ilogger-in-jobs 2024-02-08 18:27:44 +01:00
Ferdinand Thiessen
cdf7840d00
Merge pull request #43454 from nextcloud/fix/cleanup-cron-php
Cleanup cron.php method calls
2024-02-08 16:21:02 +01: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 +01:00
Côme Chilliet
1eb89421cc
fix(cron.php): Avoid pulling configuration twice
IConfig is a small wrapper around SystemConfig, no need to pull both of them

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-08 14:38:03 +01:00
Côme Chilliet
ecfa7c3ca3
chore(cron.php): Migrate uses of legacy classes from lib/private/legacy
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-08 14:31:34 +01:00
Côme Chilliet
65d013b9ae
fix(cron.php): Use new IAppConfig interface in cron.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-08 14:16:44 +01:00
Côme Chilliet
eb89da9f30
chore(cron.php): Migrate away from ILogger and \OC::$server
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-08 13:57:48 +01:00
Côme Chilliet
b105603fd1 chore: Remove last uses of IJob::execute method
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-08 10:28:29 +01:00
Joas Schilling
eeb0007cd3
fix(cron): Fix "Using $this when not in object context"
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-01-10 15:51:22 +01:00
Joas Schilling
b8c57efaad
fix(log): Improve logging of background job details for better reproduction/debugging
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-12-20 15:35:40 +01:00
Joas Schilling
28b55bba55
feat(cron): Warn on excessive memory consumption in background jobs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-12-20 10:58:08 +01:00
Julius Härtl
c8a6dad519
Cleanup tempfiles after each cron job run
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-05-30 18:01:51 +02: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 +03:00
Joas Schilling
3fd55cb4df
Allow sysadmins to define a maintenance window where heavier jobs can run
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-07 13:54:54 +01:00
Louis Chemineau
6afab63e09 Output exception in cron
Signed-off-by: Louis Chemineau <louis@chmn.me>
2021-08-19 12:40:55 +02:00
smichel17
84d3a5f8e6 cron: exit 1 on exception
Allows the caller to more easily respond to cron failures.

Signed-off-by: Stephen Michel <git@smichel.me>
2021-08-08 11:59:51 -04:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Christoph Wurst
9ce3ea3368
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-30 14:07:05 +01:00
Roeland Jago Douma
adc4f1a811
Merge pull request #22916 from J0WI/unifiy-links-to-php.net
Unify links to php.net
2020-12-22 09:53:31 +01:00
Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +01:00
hoellen
563f1318cd Remove posix_getpwuid and compare only userid
Signed-off-by: hoellen <dev@hoellen.eu>
2020-10-06 13:03:08 +02:00
J0WI
68ce17e59b Unify links to php.net
Update all links to https://www.php.net/

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2020-09-17 17:40:04 +02:00
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst
1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Michael Kuhn
ab6a18f420 cron: Adapt to 5 minutes recommendation
Update the comment to make clear that we ask for 14 minutes worth of
jobs on purpose so at most three parallel cron jobs are running.

Signed-off-by: Michael Kuhn <michael@ikkoku.de>
2020-02-17 21:47:19 +01:00