original_string: public static function adhoc_task_complete(adhoc_task $task) {
          global $DB;
  
          // Finalise the log output.
          logmanager::finalise_log();
  
          // Delete the adhoc task record - it is finished.
          $DB->delete_records('task_adhoc', array('id' => $task->get_id()));
  
          // Reschedule and then release the locks.
          if ($task->is_blocking()) {
              $task->get_cron_lock()->release();
          }
          $task->get_lock()->release();
      }
code: public static function adhoc_task_complete(adhoc_task $task) {
          global $DB;
  
          // Finalise the log output.
          logmanager::finalise_log();
  
          // Delete the adhoc task record - it is finished.
          $DB->delete_records('task_adhoc', array('id' => $task->get_id()));
  
          // Reschedule and then release the locks.
          if ($task->is_blocking()) {
              $task->get_cron_lock()->release();
          }
          $task->get_lock()->release();
      }
code_tokens: public static function adhoc_task_complete ( adhoc_task $ task ) { global $ DB ; // Finalise the log output. logmanager :: finalise_log ( ) ; // Delete the adhoc task record - it is finished. $ DB -> delete_records ( 'task_adhoc' , array ( 'id' => $ task -> get_id ( ) ) ) ; // Reschedule and then release the locks. if ( $ task -> is_blocking ( ) ) { $ task -> get_cron_lock ( ) -> release ( ) ; } $ task -> get_lock ( ) -> release ( ) ; }
docstring: This function indicates that an adhoc task was completed successfully.
  
  @param \core\task\adhoc_task $task
docstring_tokens: This function indicates that an adhoc task was completed successfully .