abh1sar commented on code in PR #12792:
URL: https://github.com/apache/cloudstack/pull/12792#discussion_r2929810922


##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -1551,6 +1553,17 @@ public boolean deleteBackup(final Long backupId, final 
Boolean forced) {
         throw new CloudRuntimeException("Failed to delete the backup");
     }
 
+    private void checkForPendingBackupJobs(final BackupVO backup) {
+        String backupUuid = backup.getUuid();
+        long pendingJobs = asyncJobManager.countPendingJobs(backupUuid,
+                CreateVMFromBackupCmd.class.getName(),
+                CreateVMFromBackupCmdByAdmin.class.getName(),
+                RestoreBackupCmd.class.getName());
+        if (pendingJobs > 0) {
+            throw new CloudRuntimeException("Cannot delete backup while a 
create instance from backup or restore operation is in progress, please try 
again later.");

Review Comment:
   ```suggestion
               throw new CloudRuntimeException("Cannot delete Backup while a 
create Instance from Backup or restore Backup operation is in progress, please 
try again later.");
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to