diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/CosmosThrottled.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/CosmosThrottled.java index 52020f5609420..4e1bdd2b1951a 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/CosmosThrottled.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/CosmosThrottled.java @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.azure.data.tables; import com.azure.core.exception.AzureException; @@ -19,7 +21,10 @@ protected CosmosThrottled(T client, boolean isPlaybackMode) { public abstract boolean isCosmos(); public void runVoid(Consumer action) { - run(c -> { action.accept(c); return null; }); + run(c -> { + action.accept(c); + return null; + }); } public T getClient() { @@ -33,26 +38,20 @@ public TResult run(Function action) { int retryCount = 0; int delay = 1500; - while (true) - { - try - { + while (true) { + try { return action.apply(client); - } - catch (TableServiceErrorException e) - { + } catch (TableServiceErrorException e) { if (e.getResponse().getStatusCode() != 429) { throw e; } - if (++retryCount > 10) - { + if (++retryCount > 10) { throw e; } // Disable retry throttling in Playback mode. - if (!isPlaybackMode) - { + if (!isPlaybackMode) { try { Thread.sleep(delay); } catch (InterruptedException interruptedException) {