original_string: public static function clear_fail_delay(scheduled_task $task) {
          global $DB;
  
          $record = new \stdClass();
          $record->id = $DB->get_field('task_scheduled', 'id',
                  ['classname' => self::get_canonical_class_name($task)]);
          $record->nextruntime = $task->get_next_scheduled_time();
          $record->faildelay = 0;
          $DB->update_record('task_scheduled', $record);
      }
code: public static function clear_fail_delay(scheduled_task $task) {
          global $DB;
  
          $record = new \stdClass();
          $record->id = $DB->get_field('task_scheduled', 'id',
                  ['classname' => self::get_canonical_class_name($task)]);
          $record->nextruntime = $task->get_next_scheduled_time();
          $record->faildelay = 0;
          $DB->update_record('task_scheduled', $record);
      }
code_tokens: public static function clear_fail_delay ( scheduled_task $ task ) { global $ DB ; $ record = new \ stdClass ( ) ; $ record -> id = $ DB -> get_field ( 'task_scheduled' , 'id' , [ 'classname' => self :: get_canonical_class_name ( $ task ) ] ) ; $ record -> nextruntime = $ task -> get_next_scheduled_time ( ) ; $ record -> faildelay = 0 ; $ DB -> update_record ( 'task_scheduled' , $ record ) ; }
docstring: Clears the fail delay for the given task and updates its next run time based on the schedule.
  
  @param scheduled_task $task Task to reset
  @throws \dml_exception If there is a database error
docstring_tokens: Clears the fail delay for the given task and updates its next run time based on the schedule .