Thank you for your help which saved us
Just a note : we can just use "admin/tool/task/cli/adhoc_task.php --execute" (specifying the task doesn't work).
Cheers.
In order to "patch" (temporarily fix the problem) I did 2 things:
1) en /admin/settings.php?section=taskprocessing
I hope this can help you.
*/5 * * * * /usr/bin/php /var/..../cron.php
Re: send_user_notifications (cron forum task)
I want to thank you for all your help. I have 5-week 11 free online courses going on, now, so getting email notifications from the forums is very important to the the teachers and the participants. I'm kind of desperate, but with no funding to get professional help.
I made the change in the file manager as stated, but don't see any email notifications from the forums. Is there anything else I need to do?
This is what I see. Where do I add the changes?
$task = new \mod_forum\task\send_user_digests();
$task->set_userid($user->id);
$task->set_component('mod_forum');
$task->set_next_run_time($digesttime);
\core\task\manager::reschedule_or_queue_adhoc_task($task);
$usercounts['digests']++;
$send = true;
Re: send_user_notifications (cron forum task)
$task->set_userid($user->id);
$task->set_component('mod_forum');
$task->set_next_run_time($digesttime);
\core\task\manager::reschedule_or_queue_adhoc_task($task);
$usercounts['digests']++;
$send = true;
Could you please explain to us in more detail what is your situation?
Can you show us what you see when you use the following command ?
/usr/bin/php /moodle_path/php/admin/tool/task/cli/adhoc_task.php --execute
This is the command that should send all notifications from forums (among other actions). Exemple :
Execute adhoc task: mod_forum\task\send_user_notifications
... started 07:26:02. Current memory use 40.6Mo.
Sending messages to student_login (269404)
Post 241357 sent
Sent 1 messages with 0 failures
Marking posts as read
Marked 1 posts as read
... used 23 dbqueries
... used 0.065815925598145 seconds
Adhoc task complete: mod_forum\task\send_user_notifications
Is this process new to Moodle V 3.10? I have never encountered the need for this command before. Do I add the command to under the account cron? This is what I have right now: /usr/local/bin/php /home/moodle4teachers/public_html/admin/cli/cron.php >/dev/null 2>&1 and it works for everything like badges, mail messages, course completion and so on.
This is what I got when I added your /usr/bin/php /moodle_path/php/admin/tool/task/cli/adhoc_task.php --execute
Cron <moodle4teachers@server> /usr/bin/php /moodle_path/php/admin/tool/task/cli/adhoc_task.php --execute
Status: 404 Not Found
Content-type: text/html; charset=UTF-8
No input file specified.
Re: send_user_notifications (cron forum task)
Ad hoc
Showing success but no email notifications are received.
Execute adhoc task: core_course\task\course_delete_modules ... started 05:29:55. Current memory use 3.7MB. !!! Coding error detected, it must be fixed by a programmer: A lock was created but not released at: [dirroot]/lib/cronlib.php on line 154 Code should look like: $factory = \core\lock\lock_config::get_lock_factory('type'); $lock = $factory->get_lock(ad639a871d90454e0b679d1c4569bfdc55160c17); $lock->release(); // Locks must ALWAYS be released like this.
First:
#php admin/tool/task/cli/schedule_task.php --execute=\\mod_forum\\task\\cron_task
and later:
#php admin/tool/task/cli/adhoc_task.php --execute=\\mod_forum\\task\\send_user_notifications
Perhaps an alternative is in the task scheduler to temporarily stop that task that is generating an error. to see if when it runs again if it sends the regulations.
Re: send_user_notifications (cron forum task)
I also started purging cache after each update which helped a bit.