Cron Job not working

Cron Job not working

by Yogesh Shirsath -
Number of replies: 0

Cron job stops working when cleanup task starts. I am using Moodle 3.3.2+
Following is the output of admin/cron.php
Execute adhoc task: core_course\task\course_delete_modules
... started 14:52:10. Current memory use 3.6MB.
!!! Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
[dirroot]/lib/classes/task/manager.php on line 463

 Code should look like:

 $factory = \core\lock\lock_config::get_lock_factory('type');
 $lock = $factory->get_lock(Resource id #191);
 $lock->release();  // Locks must ALWAYS be released like this.

 !!!
!! 
Error code: codingerror !!
!! Stack trace: * line 117 of /lib/classes/lock/lock.php: coding_exception thrown
* line 91 of /lib/cronlib.php: call to core\lock\lock->__destruct()
* line 81 of /admin/cron.php: call to cron_run()
 !!

Average of ratings: -