Skip to content

Commit

Permalink
fixed global tables not deleted in AWSDynamoUtils due to missing glob…
Browse files Browse the repository at this point in the history
…al table exception
  • Loading branch information
albogdano committed May 16, 2023
1 parent 1877440 commit b32be05
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,14 @@ public static boolean deleteTable(String appid) {
try {
// this only removes the replicas for each region - it DOES NOT delete the actual replica tables
getClient().updateGlobalTable(b -> b.globalTableName(table).replicaUpdates(replicaUpdates));
} catch (Exception ex) {
logger.error(null, ex);
} finally {
getReplicaRegions().stream().forEach(region -> {
DynamoDbAsyncClient asyncdb = DynamoDbAsyncClient.builder().region(Region.of(region)).build();
asyncdb.deleteTable(b -> b.tableName(table));
logger.info("Deleted DynamoDB table '{}' in region {}.", table, region);
});
} catch (Exception ex) {
logger.error(null, ex);
}
} else {
getClient().deleteTable(b -> b.tableName(table));
Expand Down

0 comments on commit b32be05

Please sign in to comment.