Commit Graph

82 Commits

Author SHA1 Message Date
Mark Johnson 10de329397 MDL-81714 grades: Add regrading progress indicator to grade reports 2025-03-14 16:01:05 +00:00
Huong Nguyen a35335a9c4 MDL-84729 core: Use core\clock for Tasks
This will help to solve the random failure on "test_adhoc_task_get_first_starting_time"
2025-03-04 16:27:32 +07:00
Jake Dallimore 17eb4af339 MDL-79843 core_task: changes to support deprecated plugin types
This ensures:
- existing adhoc tasks will run and be cleared from the queue
- new adhoc tasks cannot be scheduled
- scheduled tasks cannot be listed or fetched via scheduling
Given the nature of the task API, since all tasks are just objects,
a manually created task can still be run via its ::execute() method.
2025-01-28 14:42:19 +08:00
waleedhassan c0572a0423 MDL-81780 tool_task : Adhoc task improvements
Added fail delay column in the adhock task table on the admin page,
Added a new column for a delete action for the adhoc tasks on and
Wrote delete_adhoctask.php for delete functionality of adhoc tasks.
Wrote behat test for the delete functionality. Also there was a
logical error in the previous code where it was checking if the task
is due or not and it was just showing Never or ASAP instead of
actual time so fixed that as well.
2025-01-16 12:16:04 +00:00
David Carrillo 6fe29f7bc1 MDL-83367 tasks: Apply trim() to pathtophp setting
- It fixes the problem that when "pathtophp" setting is stored with
whitespaces, the "Run now" button will still show up in the tasks list,
but the task will never run
2024-10-07 08:15:19 +02:00
Johannes Burk 3ba36a9082 MDL-81689 tests: Check task DB record for nextruntime 2024-07-26 10:30:40 +02:00
Daniel Ziegenberg 047bd74c8b MDL-74843 tasks: Deprecation \core\task\manager::ensure_adhoc_task_qos
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-06-21 16:41:21 +02:00
Andrew Nicols 6f1df841f7 MDL-67667 core: Deprecate and removal task blocking
There are inherent issues with task blocking which mean that it has
never worked properly. It is also very buggy and can lead to massive
performance issues with task processing.

It is almost impossible to deprecate this in a staged fashion because
various APIs use the methods and it is not possible to determine which
are API uses and which are other valid uses.

In reality there has been little-to-no uptake on the use of this feature
and it should just be removed.
2024-04-12 12:34:20 +08:00
raortegar 10ecfa731d MDL-79131 core: Dispatch the new Hook 2024-04-03 09:08:50 +02:00
raortegar 8698a9a229 MDL-81000 core: Update "attemptsavailable" value and remove "MAX_RETRY" 2024-03-27 14:00:52 +01:00
Jun Pataleta 3278ce7aba Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Huong Nguyen c068b01a1a MDL-80749 adhoc_task: Update failed ad-hoc tasks cleanup
Update the task to use firststartingtime instead of timestarted
2024-03-04 10:17:14 +07:00
Huong Nguyen 17c01d9d74 MDL-80749 adhoc_task: Log the first starting time of the task 2024-03-04 10:17:09 +07:00
Eloy Lafuente (stronk7) ba1f804ffa MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Andrew Nicols 3451175f22 Merge branch 'MDL-80684-master-fail_running_tasks_on_shutdown' of https://github.com/praxisdigital/moodle 2024-02-28 14:16:13 +08:00
Andrew Nicols 8ebd9f08e4 MDL-80862 core: Tidy up state vars in task manager 2024-02-20 12:44:58 +08:00
Andrew Nicols becd11a84a MDL-80862 testing: Reset task manager between behat tests 2024-02-20 10:54:12 +08:00
Frederik Milling Pytlick ab517483a0 MDL-80684 core: Fail running tasks on shutdown
When you kill a process which is executing a task, it now marks it as failed.
2024-02-19 12:07:56 +01:00
Andrew Nicols b156b34552 Merge branch 'MDL-80667' of https://github.com/paulholden/moodle 2024-02-08 15:32:28 +08:00
Huong Nguyen 379e48c1fd MDL-74775 adhoc_task: Do not clear the timecreated of failed tasks 2024-01-29 09:57:33 +07:00
Paul Holden 31af1ac7e2 MDL-80667 task: preserve environment when running tasks from web.
For sites that rely on environment variables to set configuration,
ensure they are also present when executing task process.

Co-authored-by: Olivier Wenger <olivier.wenger@liip.ch>
2024-01-18 16:47:44 +00:00
Stevani Andolo 2425e07db3 MDL-79130 task_adhoc: Defined max retry constant 2024-01-10 10:17:42 +08:00
Huong Nguyen bd3af64741 MDL-79128 adhoc_task: Added 'Never' status for ad-hoc task Next run
Co-authored-by: Stevani Andolo <stevani.andolo@moodle.com>
2023-12-20 13:55:13 +07:00
Huong Nguyen f13392d230 MDL-79128 adhoc_task: Implement failed ad-hoc task cleanup
Co-authored-by: Stevani Andolo <stevani.andolo@moodle.com>
2023-12-20 13:55:13 +07:00
Huong Nguyen 6c047c40b7 MDL-79128 adhoc_task: Only rerun the allowed task
Co-authored-by: Stevani Andolo <stevani.andolo@moodle.com>
2023-12-20 13:55:13 +07:00
Huong Nguyen a44f14c79e MDL-79128 adhoc_task: Implement no-retry task
Co-authored-by: Stevani Andolo <stevani.andolo@moodle.com>

Including in this commit:
 - Added a new counter called attemptsavailable for ad-hoc task
 - PHPUnit test for the new feature
2023-12-20 13:55:13 +07:00
Brendan Heywood 76c940134c MDL-80309 tasks: Clean up mtrace logs 2023-12-07 12:08:29 +08:00
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