Commit Graph

55 Commits

Author SHA1 Message Date
Sara Arjona
9ce4fb65fd Merge branch 'MDL-77164-master' of https://github.com/marinaglancy/moodle 2023-04-13 14:00:18 +02:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01: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
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
Ilya Tregubov
41cf7a58f1 MDL-73293 core_task: patch for undefined propety. 2022-06-15 11:31:31 +04:00
Cameron Ball
cd1a7291ea MDL-73293 core_task: Cleanup stale adhoc task metadata 2022-06-09 14:15:37 +08:00
Cameron Ball
8154aa2e03 MDL-67648 tasks: Fair-share scheduling with resource management
This patch changes the way adhoc tasks are chosen to run. It now calculates
how many runners each type of adhoc task should be allowed to use. In the
case that not all the runners are utilised, it attempts to infer which
tasks do not take a long time to run, and gives those to the vacant runners.

Thanks to Brendan Heywood for guidance and SQL help.
2022-05-25 09:38:41 +08:00
Paul Holden
4102ae35a4 MDL-74283 dml: replace hardcoded concat SQL with appropriate API. 2022-03-22 17:33:03 +00:00
Sara Arjona
730bc8735e MDL-74141 tool_task: Display error when Path to CLI not defined
When "Path to PHP CLI" is not defined, an exception with the message
in cannotfindthepathtothecli should be displayed, and the page should
be redirected to System paths settings page.

Apart from that, this patch also replaced core_task to tool_task,
because this message wasn't traslated properly.
2022-03-10 16:19:07 +01:00
Brendan Heywood
a113af2446 MDL-73207 cron: Fixed cronspec field order bug 2021-12-06 17:52:40 +11:00
Sara Arjona
d9df954a25 Merge branch 'MDL-68768-adhoc-task-faildelay-check' of https://github.com/brendanheywood/moodle 2021-01-12 10:06:53 +01:00
Eloy Lafuente (stronk7)
fd1d9fec1e Merge branch 'master_MDL-70520' of https://github.com/golenkovm/moodle 2021-01-07 00:17:08 +01:00
Mikhail Golenkov
eb694bdd5a MDL-70520 tasks: Keep lastruntime when a scheduled task is reset 2020-12-22 10:37:43 +11:00
Brendan Heywood
71f180447a MDL-68768 tool_tasks: Check for failing adhoc tasks 2020-12-15 12:49:00 +11:00
Jamie Stamp
2fee98919d MDL-70341 tasks: Allow disabled tasks to be overridden 2020-12-07 16:53:19 +00:00
Jamie Stamp
3a232840a5 MDL-65843 tasks: Allow schedules to be overridden in config 2020-11-18 12:44:05 +00:00
Mikhail Golenkov
d7342dc239 MDL-67211 Tasks: Add cron_enabled setting.
Co-authored-by: Sam Marshall <s.marshall@open.ac.uk>
2020-08-25 17:08:57 +10:00
Mikhail Golenkov
b465a541ae MDL-67211 Tasks: Record when a task is running.
Co-authored-by: Sam Marshall <s.marshall@open.ac.uk>
2020-08-25 17:08:03 +10:00
Peter Burnett
e63b6b8665 MDL-69170 task: Added timecreated field to adhoc task table 2020-08-05 09:41:25 +10:00
cescobedo
db15746c2d MDL-63580 core_task: Deprecation cron_run_single_task and run_from_cli
Also we have move the functions in \tool_task\run_from_cli to \core\task\manager
and we have deprecated that class.
2020-05-11 10:53:23 +02:00
Brendan Heywood
611d6c1e29 MDL-68433 tasks: Limit the adhoc task queue look ahead 2020-04-16 23:33:07 +10:00
Tim Hunt
6fdc0f8796 MDL-68256 task admin: usability improvements
In the table that lists the scheduled tasks:

1. There are badges to show which components are disabled.
2. The plugin name (e.g. auth_ldap) is shown as well as the
   human-readable name (e.g. LDAP server).
3. Where a time column has a non-default value, it is highlighted
   and the default is shown.
4. If the fail-delay is non-zero, the cell is highlighted.
4. If you just interacted with a task (looked at or edited the settings,
   did Run now, or cleared the fail delay) that row is highlighted,
   and scrolled into view when the page loads.

To support this, some of the methods for loading the default tasks
have been extended with an optional argument to leave 'R' as 'R'
rather than replacing with a random number.

Also, mixed into this commit are a bunch of coding style improvements.
Sorry I did not separate them out, but ultimately this makes the
Moodle code better.
2020-03-28 18:40:51 +00:00
Mikhail Golenkov
e63040d02b MDL-67980 tasks: Sort ad-hoc tasks by nextruntime. 2020-02-24 09:30:09 +11:00
Brendan Heywood
b0544ce211 MDL-67486 cron: Improve throughput by holding cron lock for less time 2020-01-12 01:02:57 +11:00
Andrew Nicols
217a9b1ca0 Merge branch 'master_MDL-67485' of https://github.com/golenkovm/moodle 2020-01-09 12:39:28 +08:00
Mikhail Golenkov
6b2e15f6c5 MDL-67485 task: Release the task runner lock before throwing exception. 2020-01-09 14:29:58 +11:00
Mikhail Golenkov
1d0b74b2a3 MDL-64610 task: Add support for per-task concurrency limits. 2020-01-02 16:05:47 +11:00
Brendan Heywood
c7ce7601a3 MDL-67483 tasks: Improvements to adhoc task queue at very high scale 2019-12-19 10:49:16 +10:00
Brendan Heywood
4971da0bfa MDL-67363 task: Add adhoc task quality of service balancing 2019-12-03 12:21:10 +11:00
Andrew Nicols
b51b696927 MDL-46881 core: Allow adhoc tasks to be rescheduled 2019-01-30 10:55:48 +08:00
Andrew Nicols
8c69e86cd4 MDL-49399 task: Add admin log viewer
AMOS BEGIN
 CPY [eventstarttime,core_calendar],[task_starttime,core_admin]
 CPY [eventduration,core_calendar],[task_duration,core_admin]
 CPY [result,core_cache],[task_result,core_admin]
 CPY [database,install],[task_dbstats,core_admin]
 CPY [fail,install],[task_result:failed,core_admin]
AMOS END
2019-01-16 12:14:25 +08:00
Andrew Nicols
4b71596fc9 MDL-49399 task: Add task logging API 2019-01-16 12:14:25 +08:00
sam marshall
470d59d31f MDL-61063 Scheduled tasks: Add link to clear fail delay 2018-01-12 11:10:29 +00:00
Andrew Nicols
7e4c4b6f1f MDL-59084 core: Allow adhoc tasks to run as a specified user 2017-09-12 21:58:50 +08:00
Marina Glancy
96e1633f57 MDL-59768 tasks: schedule task only if it is not scheduled 2017-08-31 14:31:17 +08:00
Ryan Wyllie
0f268f5db9 MDL-59150 admin: build site theme after CLI install or upgrade 2017-07-18 06:13:07 +00:00
Brendan Heywood
504d569b71 MDL-50719 cron: Fixed parallel task lock contention issues 2017-02-24 13:13:23 +11:00
Daniel Neis Araujo
dfb9daeae2 MDL-52385 tasks: Queue ad-hoc tasks in future 2016-04-07 11:49:52 +08:00
Michael Aherne
1dc462baa5 MDL-51707 cron: Prevent finished tasks being returned 2015-10-08 14:43:56 +01:00
Frederic Massart
b2f6f88dc2 MDL-50532 tasks: Delete obsolete tasks during upgrade 2015-07-29 11:25:16 +08:00
Ankit Agarwal
c44b4213e6 MDL-47480 tasks: Define order for getting tasks 2015-06-02 08:08:04 +05:30
Frederic Massart
3630ab92d9 MDL-47529 task: Remove usage of lock when editing a task 2015-02-12 11:16:20 +08:00
Frederic Massart
0af336ef93 MDL-47529 task: Do not use lock when updating task records 2015-02-12 11:16:20 +08:00
Frederic Massart
18247eb090 MDL-48383 task: Indicate when a task will not run if plugin is disabled 2015-01-22 11:07:52 +08:00
Ankit Agarwal
4047cd751f MDL-48442 tasks: Make sure first run is as per schedule 2015-01-02 14:53:50 +05:30
David Mudrák
5429afc042 MDL-48156 task: Skip the scheduled task only for really disabled plugins 2014-11-10 11:09:25 +01:00
Damyon Wiese
852ff0372f MDL-47499 tasks: Scheduled tasks custom schedule is reset on upgrade.
Add a unit test for reset_scheduled_tasks_for_component and make sure it doesn't clear
customised schedules for existing tasks.
2014-10-14 14:59:24 +08:00
Damyon Wiese
a0ac406055 MDL-46904 core_task: Gracefully handle rubbish entries in the tasks table. 2014-08-20 17:01:15 +08:00