wafaahamdy / moodle-tool_resetpasswords

A Moodle Plugin for bulk reset password
Other
0 stars 1 forks source link

Problem running scheduled task #5

Open roland04 opened 7 months ago

roland04 commented 7 months ago

When running the scheduled task in isolation the following error is shown:

Execute scheduled task: Bulk rest password (tool_resetpasswords\task\bulkreset_passwords)
... started 14:42:48. Current memory use 13.2 MB.
Creating passwords for new users...
... used 4 dbqueries
... used 0.0072200298309326 seconds
Scheduled task failed: Bulk rest password (tool_resetpasswords\task\bulkreset_passwords),Call to undefined function user_update_user()
Backtrace:
* line 61 of /admin/tool/resetpasswords/classes/task/bulkreset_passwords.php: call to reset_password_sendmail()
* line 405 of /lib/classes/cron.php: call to tool_resetpasswords\task\bulkreset_passwords->execute()
* line 166 of /admin/cli/scheduled_task.php: call to core\cron::run_inner_scheduled_task()
danmarsden commented 7 months ago

I also note the scheduled task is configured to run every minute by default - that's pretty heavy and it might be more appropriate to look at making the default to run every hour.

wafaahamdy commented 6 months ago

I created a new class for handling password reset and sending email, so this error should not appear

I also changed the default task time to run every 15 mins. as the task is not heavy in checking, what may take time is sending email and it many be better not to accumulate them