From c2d522485d4d36bc31fb0c833dca8947795d3b14 Mon Sep 17 00:00:00 2001 From: Jonathan Hess Date: Tue, 18 Jul 2023 09:42:03 -0600 Subject: [PATCH] chore: code review comments. --- .../cloud/sql/core/CloudSqlInstance.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/com/google/cloud/sql/core/CloudSqlInstance.java b/core/src/main/java/com/google/cloud/sql/core/CloudSqlInstance.java index 8114be62e..4691ad861 100644 --- a/core/src/main/java/com/google/cloud/sql/core/CloudSqlInstance.java +++ b/core/src/main/java/com/google/cloud/sql/core/CloudSqlInstance.java @@ -189,19 +189,11 @@ void forceRefresh() { forceRefreshRunning = true; nextInstanceData.cancel(false); - if (nextInstanceData.isCancelled()) { - logger.fine( - "Force Refresh: the next refresh operation was cancelled." - + " Scheduling new refresh operation immediately."); - currentInstanceData = executor.submit(this::performRefresh); - nextInstanceData = currentInstanceData; - } else { - logger.fine( - "Force Refresh: the next refresh operation is already running." - + " Marking it as the current operation."); - // Otherwise it's already running, so just move next to current. - currentInstanceData = nextInstanceData; - } + logger.fine( + "Force Refresh: the next refresh operation was cancelled." + + " Scheduling new refresh operation immediately."); + currentInstanceData = executor.submit(this::performRefresh); + nextInstanceData = currentInstanceData; } }