WisdmLabs / moodle-block_edwiser_site_monitor

GNU General Public License v3.0
6 stars 4 forks source link

schedule task : cron_task broken #10

Closed ak4t0sh closed 5 years ago

ak4t0sh commented 5 years ago

e2be4075 broke \block_edwiser_site_monitor\task\cron_task.

you are calling block_edwiser_site_monitor_uitility::edwiser_site_monitor_cron() but block_edwiser_site_monitor_uitility does not exists

test@test:~/www/moodle-36$ php admin/tool/task/cli/schedule_task.php --execute='\block_edwiser_site_monitor\task\cron_task'
Execute scheduled task: Edwiser Site Monitor - Collect 24 hours usage statistics (block_edwiser_site_monitor\task\cron_task)
Default exception handler: Exception - Class 'block_edwiser_site_monitor\task\block_edwiser_site_monitor_uitility' not found Debug: 
Error code: generalexceptionmessage
* line 42 of /blocks/edwiser_site_monitor/classes/task/cron_task.php: Error thrown
* line 156 of /admin/tool/task/cli/schedule_task.php: call to block_edwiser_site_monitor\task\cron_task->execute()

!!! Exception - Class 'block_edwiser_site_monitor\task\block_edwiser_site_monitor_uitility' not found !!!
!! 
Error code: generalexceptionmessage !!
!! Stack trace: * line 42 of /blocks/edwiser_site_monitor/classes/task/cron_task.php: Error thrown
* line 156 of /admin/tool/task/cli/schedule_task.php: call to block_edwiser_site_monitor\task\cron_task->execute()
 !!
PHP Fatal error:  Uncaught coding_exception: Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
/home/test/www/moodle-36/admin/tool/task/cli/schedule_task.php on line 141

 Code should look like:

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

 in /home/test/www/moodle-36/lib/classes/lock/lock.php:117
Stack trace:
#0 [internal function]: core\lock\lock->__destruct()
#1 {main}
  thrown in /home/test/www/moodle-36/lib/classes/lock/lock.php on line 117

Fatal error: Uncaught coding_exception: Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
/home/test/www/moodle-36/admin/tool/task/cli/schedule_task.php on line 141

 Code should look like:

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

 in /home/test/www/moodle-36/lib/classes/lock/lock.php:117
Stack trace:
#0 [internal function]: core\lock\lock->__destruct()
#1 {main}
  thrown in /home/test/www/moodle-36/lib/classes/lock/lock.php on line 117