@@ -947,13 +947,13 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
947947 return true ;
948948 }
949949
950- public boolean isDisabled (final Long zoneId ) {
951- return !(BackupFrameworkEnabled .valueIn ( zoneId ));
950+ public boolean isDisabled () {
951+ return !(BackupFrameworkEnabled .value ( ));
952952 }
953953
954954 private void validateForZone (final Long zoneId ) {
955- if (zoneId == null || isDisabled (zoneId )) {
956- throw new CloudRuntimeException ("Backup and Recovery feature is disabled for the zone " );
955+ if (zoneId == null || isDisabled ()) {
956+ throw new CloudRuntimeException ("Backup and Recovery feature is disabled" );
957957 }
958958 }
959959
@@ -1128,7 +1128,7 @@ public void scheduleBackups() {
11281128 continue ;
11291129 }
11301130
1131- if (isDisabled (vm . getDataCenterId () )) {
1131+ if (isDisabled ()) {
11321132 continue ;
11331133 }
11341134
@@ -1237,12 +1237,11 @@ protected void runInContext() {
12371237 if (logger .isTraceEnabled ()) {
12381238 logger .trace ("Backup sync background task is running..." );
12391239 }
1240+ if (isDisabled ()) {
1241+ logger .debug ("Backup Sync Task is not enabled. Skipping!" );
1242+ return ;
1243+ }
12401244 for (final DataCenter dataCenter : dataCenterDao .listAllZones ()) {
1241- if (dataCenter == null || isDisabled (dataCenter .getId ())) {
1242- logger .debug ("Backup Sync Task is not enabled in zone [{}]. Skipping this zone!" , dataCenter == null ? "NULL Zone!" : dataCenter );
1243- continue ;
1244- }
1245-
12461245 final BackupProvider backupProvider = getBackupProvider (dataCenter .getId ());
12471246 if (backupProvider == null ) {
12481247 logger .warn ("Backup provider not available or configured for zone {}" , dataCenter );
0 commit comments