You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2019/01/15 17:43:53 UTC

[GitHub] rafaelweingartner commented on a change in pull request #3122: Add back ability to disable backup of snapshot to secondary

rafaelweingartner commented on a change in pull request #3122: Add back ability to disable backup of snapshot to secondary
URL: https://github.com/apache/cloudstack/pull/3122#discussion_r247994364
 
 

 ##########
 File path: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
 ##########
 @@ -1123,12 +1123,24 @@ public SnapshotInfo takeSnapshot(VolumeInfo volume) throws ResourceAllocationExc
             }
 
             SnapshotInfo snapshotOnPrimary = snapshotStrategy.takeSnapshot(snapshot);
-            if (payload.getAsyncBackup()) {
-                backupSnapshotExecutor.schedule(new BackupSnapshotTask(snapshotOnPrimary, snapshotBackupRetries - 1, snapshotStrategy), 0, TimeUnit.SECONDS);
+            boolean backupFlag = BackupSnapshotAfterTakingSnapshot.value() == null ||
+                    BackupSnapshotAfterTakingSnapshot.value();
+
+            if (backupFlag) {
+                if (payload.getAsyncBackup()) {
 
 Review comment:
   can you extract lines 1130-1136 to a method? This will also allow you to document it, and then to unit test it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services