LafColITS / moodle-tool_deletecourses

Moodle plugin which allows managers to delete all courses in a category (including subcategories).
7 stars 6 forks source link

Coding error detected, it must be fixed by a programmer: A lock was created but not released #14

Closed mnods closed 3 years ago

mnods commented 3 years ago

Hi, getting this on mdl 3.9.3

Adhoc task failed: tool_deletecourses\task\delete_courses_task,Coding error detected, it must be fixed by a programmer: A lock was created but not released at: admin/tool/deletecourses/classes/task/delete_courses_task.php on line 108

Code should look like:

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

Backtrace:

mackensen commented 3 years ago

This typically means that there was a fatal error during execution, and not necessarily related to the plugin itself. Does this keep happening, and is there any other debugging information generated?

mnods commented 3 years ago

yes, sorry, ignore me, thought it was highlighting a change of code needed for unlocking but i see it looks right now i check. On a test environment i've been fiddling with so really no surprise it failed. will run through again but i'm sure it's actually ok. cheers for reply and code, much appreciated.