Commit Graph

2602 Commits

Author SHA1 Message Date
Andrew Nicols
25f1ec59d9 MDL-77837 core: Improve usage docs for cron::setup_user 2023-04-06 23:19:01 +08:00
Andrew Nicols
12b0f796b9 MDL-77837 cron: Ensure user is set when running tasks
We should be proactive in ensuring that the environment is clean when
running a task. We already ensure that we have a clean renderer and
other parts of the output chain, but we were not setting a clean user.

This change adds a call to setup the cron user before each task is
actually executed.
2023-04-06 23:19:01 +08:00
Andrew Nicols
31f82832b6 MDL-65471 core: Sort directories before hashing 2023-04-06 15:41:00 +08:00
Andrew Nicols
eb1b172397 Merge branch 'MDL-65471-outageless' of https://github.com/Peterburnett/moodle 2023-04-06 08:36:25 +02:00
Peter Burnett
027c770eab MDL-65471 upgrade: framework to reduce maintenance mode 2023-04-06 11:38:26 +10:00
Srdjan
85323070e7 MDL-70975 task: adhoctasks.php - queued ad hoc tasks report
Similar to scheduled tasks report

core\task\manager::adhoc_task_from_record() now raises moodle_exception
2023-04-05 11:29:46 +10:00
Srdjan
6d9aaa8412 MDL-70975 task: Support for running only failed ad hoc tasks
* CLI adhoc_task.php: new option --failed
2023-04-05 11:05:23 +10:00
Srdjan
fa61fce08d MDL-70975 task: Support for limiting the number of adhoc tasks to run
* CLI adhoc_task.php: new option --taskslimit
* CLI adhoc_task.php: --execute option is implied when other options are given
* core\task\manager::get_next_adhoc_task(): new param $number
  for limiting number of tasks to run
2023-04-05 11:05:18 +10:00
Srdjan
3491ea1650 MDL-70975 task: Support for running adhoc tasks filtered by class
* CLI adhoc_task.php: new option --classname
* core\task\manager::get_next_adhoc_task(): new param $classname
  for filtering tasks
2023-04-05 11:00:46 +10:00
Srdjan
9405b5aa6d MDL-70975 task: Support for running adhoc tasks by id
* CLI adhoc_task.php: new option --id
* cron::run_adhoc_task($taskid) for running tasks by id
* core\task\manager::get_adhoc_task($taskid) for retreival/locking
2023-04-05 10:55:18 +10:00
Andrew Nicols
a262ba5d6e Merge branch 'MDL-74936' of https://github.com/skodak/moodle 2023-04-04 11:22:49 +08:00
Sara Arjona
0d8fc7d9b1 Merge branch 'MDL-76800-master' of https://github.com/raortegar/moodle 2023-04-03 12:41:14 +02:00
Petr Skoda
176191dab5 MDL-74936 core: tidy up context API 2023-03-31 23:09:39 +02:00
Petr Skoda
728c3c4bd1 MDL-74936 core: namespace all context class 2023-03-31 23:09:39 +02:00
raortegar
ca2fd15a2a MDL-76800 lib: Adapt dataformat to OpenSpout 4.0 version. 2023-03-31 09:18:14 +02:00
Andrew Nicols
64f2e494b9 Merge branch 'MDL-77783-master' of https://github.com/junpataleta/moodle 2023-03-31 11:30:54 +08:00
Ilya Tregubov
5b8c1ffd84 Merge branch 'MDL-77406' of https://github.com/AnupamaSarjoshi/moodle 2023-03-31 09:47:23 +08:00
Sara Arjona
28953bf23b Merge branch 'MDL-77693-master' of https://github.com/andrewnicols/moodle 2023-03-30 19:00:32 +02:00
Jun Pataleta
64c1a5c337 Merge branch 'MDL-77306-master' of https://github.com/junpataleta/moodle 2023-03-30 23:38:57 +08:00
Jun Pataleta
c5c065e10a MDL-77306 core: Remove LIMIT from SQL statement
Adding LIMIT to the primary auth type SQL statement does not play well
with Oracle. We can just remove the LIMIT clause from the SQL statement
and and pass IGNORE_MULTIPLE to the call to $DB->get_field_sql()
instead.
2023-03-30 23:18:27 +08:00
Andrew Nicols
e0acbbc6ea MDL-77693 core: Check the start time of a cron run when fetching tasks
When fetching the list of tasks to run, we were using the _process_
start time as a base. The various task fetchers (adhoc and scheduled)
only fetch tasks which were due to run _before_ this time.

With the new keepalive setting, we need to pass both the process start
time, and the run start time. We need to use the process start time to
determine whether MUC caches have been cleared since the process
started. but the run start time to fetch recent runs.
2023-03-30 11:35:59 +08:00
Sara Arjona
1147a9fe9d MDL-72350 mod: Remove mod_assignment
The Assignment 2.2 activity module was disabled in 2012 but kept to
enable pre-2.2 backups to be restored and have the assignments
auto-converted to new assignments. After almost 10 years, it's time
to remove it from Moodle core.
2023-03-30 09:00:10 +08:00
Matt Porritt
4c76cc46f8 MDL-77306 Site Registration: add extra statistics
Add the DB type, count of courses with start or end dates set,
default site theme, and primary auth type statistics to those
collected as part of the site registration data.
2023-03-29 15:22:28 +11:00
Jun Pataleta
e95e290532 MDL-77783 core: Validate sublugins.json
* Validate the decoded subplugins.json before processing it.
* Log errors if subplugins.json is invalid or if plugintypes is not
defined.
2023-03-29 09:29:36 +08:00
Anupama Sarjoshi
42f4b0a991 MDL-77406 core: Logs to record user file uploaded in draft area 2023-03-28 17:49:54 +01:00
Jun Pataleta
cd0afd5c76 MDL-77105 core: Method to determine whether a plugin has monolog icons 2023-03-27 13:32:09 +08:00
Andrew Nicols
dc52959313 Merge branch 'MDL-76520-master' of https://github.com/HuongNV13/moodle 2023-03-24 09:34:38 +08:00
Sara Arjona
9ec55f3091 Merge branch 'MDL-77721-master' of https://github.com/lameze/moodle 2023-03-23 16:17:51 +01:00
Huong Nguyen
359efecb03 MDL-76520 tiny_link: Add a TinyMCE link plugin
Co-authored-by: Andrew Lyons <andrew@nicols.co.uk>
2023-03-23 15:50:44 +07:00
Simey Lameze
61f4843fed MDL-77721 navigation: Revert the patch for MDL-75908.
This reverts commit 7b8fa9de86.
2023-03-23 15:45:11 +08:00
Juan Leyva
27be439eb7 MDL-73708 course: Return geo pattern generated course images via WS 2023-03-22 17:39:07 -03:00
Jake Dallimore
d001dd43ca Merge branch 'MDL-70687_default-redis-session-lock-expiration-to-php-execution-time' of https://github.com/ziegenberg/moodle 2023-03-21 15:48:03 +01:00
Paul Holden
1eb6c49fa3 Merge branch 'MDL-72124_master' of https://github.com/marxjohnson/moodle 2023-03-21 15:46:28 +01:00
Amaia Anabitarte
d535182414 MDL-77178 report: Update reports tertiary navigation 2023-03-20 11:13:55 +01:00
Andrew Nicols
7db7cde55a Merge branch 'MDL-75908-master' of https://github.com/srobotta/moodle 2023-03-17 13:03:29 +01:00
Jun Pataleta
7d9c04e2e6 Merge branch 'MDL-75650-master-simple' of https://github.com/snake/moodle 2023-03-17 13:03:28 +01:00
Stephan Robotta
7b8fa9de86 MDL-75908 navigation: fix active flag in navigation for custom menus 2023-03-15 11:16:44 +01:00
Jake Dallimore
576369bf97 Merge branch 'MDL-77186-master' of https://github.com/andrewnicols/moodle 2023-03-15 12:00:42 +08:00
Mark Johnson
95d961fc2d MDL-72124 question: Fix system-level URLs in question events 2023-03-14 15:39:42 +00:00
Andrew Nicols
f6d9b81ebc MDL-77186 core: Address coding style violations in cron 2023-03-14 11:19:03 +08:00
Andrew Nicols
3cd05c7a15 MDL-77186 core: Move cron_setup_user to namespaced class 2023-03-14 11:19:03 +08:00
Andrew Nicols
070c781097 MDL-77186 core: Move max/default cron_keepalive to class const 2023-03-14 11:19:03 +08:00
Andrew Nicols
6aba049a64 MDL-76867 core_admin: Migrate media plugin management to dynamic table 2023-03-14 08:44:15 +08:00
Andrew Nicols
6d978dd35a MDL-76867 core_admin: Add support for editor sorting via ajax 2023-03-14 08:44:15 +08:00
Andrew Nicols
fdb1df2bfd MDL-76867 core: Add plugintype_supports_disabling to plugininfo 2023-03-14 08:34:42 +08:00
Andrew Nicols
6809289cf4 MDL-76867 core: Plugintype coding style fixes 2023-03-14 08:34:42 +08:00
Andrew Nicols
9ec46c232d MDL-77186 core: Move all uses of cronlib to new class 2023-03-13 21:21:13 +08:00
Andrew Nicols
99a67b615f MDL-77186 core: Move cronlib to namespaced class 2023-03-13 21:21:13 +08:00
Nils Adermann
e63ed5511b MDL-70687 session: Redis session lock exp = max exec time
If for any reason a Redis session lock is not being released, all subsequent
requests will wait to acquire the lock, forcing them to time out eventually.
This will happen till the original lock finally expires after the session timeout.

This sets the Redis session lock expiry time to whatever is lower,
either the PHP execution time `max_execution_time`, if the value was
defined in the `php.ini` or the globally configured `sessiontimeout`.
Setting it to the lower of the two will not make things worse it if the
execution timeout is longer than the session timeout.
For the PHP execution time, once the PHP execution time is over, we can
be sure that the lock is no longer actively held so that the lock can
expire safely. Although at `lib/classes/php_time_limit.php::raise(int)`,
Moodle can progressively increase the maximum PHP execution time, this
is limited to the `max_execution_time` value defined in the `php.ini`.
For the session timeout, we assume it is safe to consider the lock to
expire once the session itself expires.
If we unnecessarily hold the lock any longer, it blocks other session
requests.

Co-authored-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2023-03-10 12:33:53 +01:00
Ilya Tregubov
58fb00eb18 Merge branch 'MDL-77308-master' of https://github.com/andrewnicols/moodle 2023-03-09 17:02:07 +08:00