Skip to content

Commit

Permalink
Use last valid config in case of failed reload
Browse files Browse the repository at this point in the history
  • Loading branch information
gitseti committed Feb 18, 2021
1 parent 3ac8995 commit 03de237
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,16 @@ public void createOrUpdate() throws IllegalStateException, IllegalArgumentExcept

final AzureDiscoveryConfig newAzureDiscoveryConfig = configReader.readConfiguration();
if (newAzureDiscoveryConfig == null) {
throw new IllegalStateException("Configuration of the Azure Cluster Discovery Extension couldn't be loaded.");
if (azureDiscoveryConfig != null) {
log.warn("Configuration of the Azure Cluster Discovery Extension couldn't be loaded. Using last valid configuration.");
}
else {
throw new IllegalStateException("Configuration of the Azure Cluster Discovery Extension couldn't be loaded.");
}
}
else {
azureDiscoveryConfig = newAzureDiscoveryConfig;
}
azureDiscoveryConfig = newAzureDiscoveryConfig;

final String connectionString = azureDiscoveryConfig.getConnectionString();
final String containerName = azureDiscoveryConfig.getContainerName();
Expand Down

0 comments on commit 03de237

Please sign in to comment.