-
Bug
-
Resolution: Fixed
-
Major
-
2.5.6, 2.6.3, 2.7
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
-
MOODLE_26_STABLE, MOODLE_27_STABLE
-
admin/tool/task/cli/schedule_task.php --execute=\\core\\task
delete_unconfirmed_users_task
ends at with output:
1
Scheduled task: Delete unconfirmed users
... used 4 dbqueries
... used 0.1089289188385 seconds
Task failed: Invalid user
discovered during MDLSITE-3002 testing on study.
also in regular cron runs:
Execute scheduled task: Delete unconfirmed users
... started 07:00:06. Current memory use 19.9MB.
... used 4 dbqueries
... used 0.24109411239624 seconds
Scheduled task failed: Delete unconfirmed users,Invalid user
public function execute() {
|
global $CFG, $DB;
|
|
$timenow = time();
|
|
// Delete users who haven't confirmed within required period.
|
if (!empty($CFG->deleteunconfirmed)) {
|
$cuttime = $timenow - ($CFG->deleteunconfirmed * 3600);
|
$rs = $DB->get_recordset_sql ("SELECT *
|
FROM {user}
|
WHERE confirmed = 0 AND firstaccess > 0
|
AND firstaccess < ?", array($cuttime));
|
foreach ($rs as $user) {
|
delete_user($user); // We MUST delete user properly first.
|
$DB->delete_records('user', array('id' => $user->id)); // This is a bloody hack, but it might work.
|
mtrace(" Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
|
}
|
$rs->close();
|
}
|
}
|
no idea why 'invalid user' but this seems non critical for MDLSITE-3002 .. going ahead there.
- has been marked as being related by
-
MDL-45490 Add docs for upgrades about the new task scheduler implications
- Closed
-
MDLSITE-3116 dev.moodle.org: \core\task\legacy_plugin_cron_task has large faildelay
- Closed
- is duplicated by
-
MDLSITE-3051 first cron after 2.7 upgrade moodle.org has slow inefficient query against message_read table
- Resolved
-
MDL-43939 Cleanup tasks on cron broken by self-registration based authentication
- Closed
- Testing discovered
-
MDLSITE-3002 META: Upgrade moodle.org to 2.7
- Closed
-
MDL-25499 Centralise management of all types of cron tasks with registration, scheduling, parallel task conflicts(blocking) and running once off tasks, all using an administration screen.
- Closed