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.
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.
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.
- 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
- 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.
- 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
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.
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.
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.
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.
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>
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.
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