Asynchronous deleting backup volume
@@ -157,14 +157,19 @@ func (b *BackupTarget) GetVolume(volumeName string) (*BackupVolume, error) {
}
func (b *BackupTarget) DeleteVolume(volumeName string) error {
+ go func() {
+ logrus.Infof("Start Deleting backup volume %s", volumeName)
_, err := b.ExecuteEngineBinaryWithoutTimeout("backup", "rm", "--volume", volumeName, b.URL)
if err != nil {
- if strings.Contains(err.Error(), "msg=\"cannot find ") {
- logrus.Warnf("delete: could not find the backup volume: '%s'", volumeName)
- return nil
+ if types.ErrorIsNotFound(err) {
+ logrus.Warnf("delete: could not find the backup volume: '%v'", volumeName)
+ return
}
- return errors.Wrapf(err, "error deleting backup volume")
+ logrus.Errorf("error deleting backup volume, error message: %v", err)
+ return
}
+ logrus.Infof("Complete deleting backup volume %v", volumeName)
+ }()
return nil
}
func (b *BackupTarget) List(volumeName string) ([]*Backup, error) {
