original_string: public static function scheduled_task_complete(scheduled_task $task) {
          global $DB;
  
          // Finalise the log output.
          logmanager::finalise_log();
  
          $classname = self::get_canonical_class_name($task);
          $record = $DB->get_record('task_scheduled', array('classname' => $classname));
          if ($record) {
              $record->lastruntime = time();
              $record->faildelay = 0;
              $record->nextruntime = $task->get_next_scheduled_time();
  
              $DB->update_record('task_scheduled', $record);
          }
  
          // Reschedule and then release the locks.
          if ($task->is_blocking()) {
              $task->get_cron_lock()->release();
          }
          $task->get_lock()->release();
      }
code: public static function scheduled_task_complete(scheduled_task $task) {
          global $DB;
  
          // Finalise the log output.
          logmanager::finalise_log();
  
          $classname = self::get_canonical_class_name($task);
          $record = $DB->get_record('task_scheduled', array('classname' => $classname));
          if ($record) {
              $record->lastruntime = time();
              $record->faildelay = 0;
              $record->nextruntime = $task->get_next_scheduled_time();
  
              $DB->update_record('task_scheduled', $record);
          }
  
          // Reschedule and then release the locks.
          if ($task->is_blocking()) {
              $task->get_cron_lock()->release();
          }
          $task->get_lock()->release();
      }
code_tokens: public static function scheduled_task_complete ( scheduled_task $ task ) { global $ DB ; // Finalise the log output. logmanager :: finalise_log ( ) ; $ classname = self :: get_canonical_class_name ( $ task ) ; $ record = $ DB -> get_record ( 'task_scheduled' , array ( 'classname' => $ classname ) ) ; if ( $ record ) { $ record -> lastruntime = time ( ) ; $ record -> faildelay = 0 ; $ record -> nextruntime = $ task -> get_next_scheduled_time ( ) ; $ DB -> update_record ( 'task_scheduled' , $ record ) ; } // Reschedule and then release the locks. if ( $ task -> is_blocking ( ) ) { $ task -> get_cron_lock ( ) -> release ( ) ; } $ task -> get_lock ( ) -> release ( ) ; }
docstring: This function indicates that a scheduled task was completed successfully and should be rescheduled.
  
  @param \core\task\scheduled_task $task
docstring_tokens: This function indicates that a scheduled task was completed successfully and should be rescheduled .