Skip to content

Commit

Permalink
MDL-38734: Automated backup failure causing all course to fail
Browse files Browse the repository at this point in the history
Conflicts:
	backup/moodle2/backup_stepslib.php
  • Loading branch information
Tony Levi authored and danpoltawski committed Oct 18, 2013
1 parent f8eff10 commit 1b55bdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions backup/moodle2/backup_stepslib.php
Expand Up @@ -39,6 +39,7 @@ protected function define_execution() {
backup_helper::check_and_create_backup_dir($this->get_backupid());// Create backup temp dir
backup_helper::clear_backup_dir($this->get_backupid(), $progress); // Empty temp dir, just in case
backup_helper::delete_old_backup_dirs(time() - (4 * 60 * 60), $progress); // Delete > 4 hours temp dirs
backup_controller_dbops::drop_backup_ids_temp_table($this->get_backupid()); // Drop ids temp table
backup_controller_dbops::create_backup_ids_temp_table($this->get_backupid()); // Create ids temp table
$progress->end_progress();
}
Expand Down
6 changes: 4 additions & 2 deletions backup/util/dbops/backup_controller_dbops.class.php
Expand Up @@ -160,8 +160,10 @@ public static function drop_backup_ids_temp_table($backupid) {
$dbman = $DB->get_manager(); // We are going to use database_manager services

$targettablename = 'backup_ids_temp';
$table = new xmldb_table($targettablename);
$dbman->drop_table($table); // And drop it
if ($dbman->table_exists($targettablename)) {
$table = new xmldb_table($targettablename);
$dbman->drop_table($table); // And drop it
}
}

/**
Expand Down

0 comments on commit 1b55bdb

Please sign in to comment.