add in a retry function into cloud config migration
Change-Id: Iee5dd2ece0262cc7087021b567d9661e0ef91d72
Issue-ID: SO-1457
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
LOGGER.debug("Starting migration for CloudConfig");
CloudConfig cloudConfig = null;
-
+
+ String tableQuery = "SELECT * FROM identity_services";
+ int totalRetries = 20;
+ boolean tableExists = false;
+ int count = 1;
+ while(!tableExists && count != totalRetries) {
+ try(Statement stmt = connection.createStatement();) {
+ stmt.executeQuery(tableQuery);
+ tableExists = true;
+ } catch (SQLException e) {
+ count++;
+ // Wait 5 mintues
+ Thread.sleep(300000);
+ }
+ }
+
// Try the override file
String configLocation = System.getProperty("spring.config.additional-location");
if (configLocation != null) {