Commit Graph

264 Commits

Author SHA1 Message Date
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
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
305952533d Merge branch 'MDL-82589' of https://github.com/paulholden/moodle 2024-11-22 10:50:48 +07:00
94568bc5e0 Merge branch 'MDL-81509_final-deprecation-of-task_base-is_blocking-and-set_blocking' of https://github.com/ziegenberg/moodle 2024-11-14 11:07:45 +07:00
22667ab397 MDL-82589 task: link to task logs report from failure notification. 2024-11-11 16:47:35 +00:00
8f9b57d5d3 MDL-46739 user preferences: change value column to TEXT.
Other similar columns config.value and config_plugins.value are TEXT, so
it is surprising that this column is different, and that has lead to
bugs in the past, so we should make it consistent.
2024-11-11 11:33:52 +00:00
c14810e7d1 MDL-81509 tasks: Final deprecation of blocking tasks
Final deprecation of task_base::is_blocking and task_base::set_blocking.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-11-08 11:05:58 +01:00
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
3ba36a9082 MDL-81689 tests: Check task DB record for nextruntime 2024-07-26 10:30:40 +02:00
42aca7aaf7 MDL-70854 core: Simplify querying of unconfirmed users
- Use $DB->count_records_select() and $DB->get_recordset_select()
instead of using full SQL queries.
- Other fixes:
  - Remove unused variable in progress_bar::update_raw()
  - poll_stored_progress tidy-ups:
    - Use validated parameter.
    - Add return types for the external methods.
2024-07-23 17:58:53 +08:00
b92886ad59 MDL-70854 core: Add stored progress bars.
- Alters existing progress_bar class to support extension
    - Adds stored_progress_bar class as child of progress_bar
    - Adds webservice to poll stored progress
    - Updates database tables
    - Bumps version
    - Adds unit/behat tests
2024-07-23 17:58:53 +08:00
79e73e1b05 Merge branch 'MDL-74843_final-deprecation-of-core_task_manager-ensure_adhoc_task_qos' of https://github.com/ziegenberg/moodle 2024-07-01 16:29:09 +02:00
d0e82b746e MDL-81807 core: Add scheduled task for updating the GeoIP database
This commit includes the following changes:

- Implemented a scheduled task to automate the download and update of the GeoIP database.
- Integrated checksum verification for the downloaded database file.
- Added new configuration settings to enable administrators to enter MaxMind account credentials,
  allowing authenticated access to both free and paid GeoIP database versions from Maxmind.
2024-06-25 15:17:30 +10:00
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
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
a1b0fe9b9c MDL-67667 core: Deprecate task blocking 2024-04-12 12:15:44 +08:00
5488908538 MDL-79131 core: Hook listener callback for failed_task_max_delay 2024-04-03 09:08:50 +02:00
10ecfa731d MDL-79131 core: Dispatch the new Hook 2024-04-03 09:08:50 +02:00
8698a9a229 MDL-81000 core: Update "attemptsavailable" value and remove "MAX_RETRY" 2024-03-27 14:00:52 +01:00
3278ce7aba Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
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
17c01d9d74 MDL-80749 adhoc_task: Log the first starting time of the task 2024-03-04 10:17:09 +07:00
29a541724f MDL-65292 style: Fix all the function declaration ordering
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration

It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.

So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
2024-02-28 23:47:47 +01:00
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
a6b2aa021a Merge branch 'mdl-80917-main' of https://github.com/Fragonite/moodle 2024-02-28 16:44:13 +01:00
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
8ebd9f08e4 MDL-80862 core: Tidy up state vars in task manager 2024-02-20 12:44:58 +08:00
becd11a84a MDL-80862 testing: Reset task manager between behat tests 2024-02-20 10:54:12 +08:00
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
34492bec74 MDL-80917 core_backup: Clear restored course cache 2024-02-15 09:06:57 +08:00
b156b34552 Merge branch 'MDL-80667' of https://github.com/paulholden/moodle 2024-02-08 15:32:28 +08:00
67a94c49c4 Merge branch 'MDL-80267-main' of https://github.com/HuongNV13/moodle 2024-02-01 11:52:36 +08:00
24fde0ce87 MDL-80267 Backup: Make sure to mark the task as failed in such cases
Adding a try-catch around the restore process to make sure that
the task will be marked as failed state if the process throws any
exceptions
2024-02-01 09:37:14 +07:00
42d76fd293 MDL-80267 task_course_restore: Prevent failed course restore 2024-02-01 09:31:08 +07:00
379e48c1fd MDL-74775 adhoc_task: Do not clear the timecreated of failed tasks 2024-01-29 09:57:33 +07:00
6239519eb8 Merge branch 'MDL-80323' of https://github.com/paulholden/moodle 2024-01-22 16:26:14 +08:00
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
12203eea69 Merge branch 'MDL-79130-master' of https://github.com/stevandoMoodle/moodle 2024-01-16 16:26:48 +08:00
75c58549e3 Merge branch 'MDL-69615-main' of https://github.com/HuongNV13/moodle 2024-01-16 10:56:27 +08:00
028c0384a2 MDL-69615 core_backup: Send backup report email once the tasks are done 2024-01-16 09:32:19 +07:00
fd8c759323 Merge branch 'MDL-79091' of https://github.com/jay-oswald/moodle 2024-01-15 12:31:35 +01:00
50c134a1ad MDL-69615 core_task: Add a task trait 2024-01-15 11:18:36 +07:00
2425e07db3 MDL-79130 task_adhoc: Defined max retry constant 2024-01-10 10:17:42 +08:00
b5cba37893 MDL-80323 h5p: fail content type retrieval task on errors.
It's better for the task to fail gracefully rather than silently
swallow any errors, so that the task API can schedule re-tries.

If the endpoint is temporarily down and/or misbehaving, this will
allow admins to have clearer failures.
2024-01-08 10:06:29 +00:00
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
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
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
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
76c940134c MDL-80309 tasks: Clean up mtrace logs 2023-12-07 12:08:29 +08:00
248f7e91f2 MDL-79091 core_badges: refactor bades cron task
MDL-79091 core_badges: refactor bades cron task
2023-12-01 10:57:36 +11:00