mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Fix backup service to have multiple backup instances (#396)
* Allow multiple backups per backup service instance * Add test to run multiple backups * Update backup cancelTask method signature * Fix to have multiple backup instances and add more tests * Address PR comments * Remove double new lines * Add Azure check for backup operations
This commit is contained in:
@@ -57,10 +57,9 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.DisasterRecovery
|
||||
// Initialize backup service
|
||||
DatabaseTaskHelper helper = AdminService.CreateDatabaseTaskHelper(liveConnection.ConnectionInfo, databaseExists: true);
|
||||
SqlConnection sqlConn = DisasterRecoveryService.GetSqlConnection(liveConnection.ConnectionInfo);
|
||||
DisasterRecoveryService.Instance.InitializeBackup(helper.DataContainer, sqlConn);
|
||||
|
||||
|
||||
// Get default backup path
|
||||
BackupConfigInfo backupConfigInfo = DisasterRecoveryService.Instance.GetBackupConfigInfo(sqlConn.Database);
|
||||
BackupConfigInfo backupConfigInfo = DisasterRecoveryService.Instance.GetBackupConfigInfo(helper.DataContainer, sqlConn, sqlConn.Database);
|
||||
string backupPath = backupConfigInfo.DefaultBackupFolder + "\\" + databaseName + ".bak";
|
||||
|
||||
var backupInfo = new BackupInfo();
|
||||
@@ -81,8 +80,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.DisasterRecovery
|
||||
};
|
||||
|
||||
// Backup the database
|
||||
DisasterRecoveryService.Instance.SetBackupInput(backupParams.BackupInfo);
|
||||
DisasterRecoveryService.Instance.PerformBackup();
|
||||
BackupOperation backupOperation = DisasterRecoveryService.Instance.SetBackupInput(helper.DataContainer, sqlConn, backupParams.BackupInfo);
|
||||
DisasterRecoveryService.Instance.PerformBackup(backupOperation);
|
||||
|
||||
// Remove the backup file
|
||||
if (File.Exists(backupPath))
|
||||
|
||||
Reference in New Issue
Block a user