abh1sar commented on code in PR #10140: URL: https://github.com/apache/cloudstack/pull/10140#discussion_r2230360081
########## server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java: ########## @@ -1470,7 +1910,22 @@ private Backup checkAndUpdateIfBackupEntryExistsForRestorePoint(Backup.RestorePo return null; } - private void syncBackups(BackupProvider backupProvider, VirtualMachine vm, Backup.Metric metric) { + private void processRemoveList(List<Long> removeList, VirtualMachine vm) { + for (final Long backupIdToRemove : removeList) { + logger.warn(String.format("Removing backup with ID: [%s].", backupIdToRemove)); + Backup backup = backupDao.findById(backupIdToRemove); + resourceLimitMgr.decrementResourceCount(backup.getAccountId(), Resource.ResourceType.backup); + resourceLimitMgr.decrementResourceCount(backup.getAccountId(), Resource.ResourceType.backup_storage, backup.getSize()); + boolean result = backupDao.remove(backupIdToRemove); + if (result) { + checkAndGenerateUsageForLastBackupDeletedAfterOfferingRemove(vm, backup); + } else { + logger.error("Failed to remove backup db wentry ith ID: {} during sync backups", backupIdToRemove); Review Comment: Done -- 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: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org