Skip to content

Commit

Permalink
chore: code review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
hessjcg committed Jul 18, 2023
1 parent 6f84508 commit c2d5224
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions core/src/main/java/com/google/cloud/sql/core/CloudSqlInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit c2d5224

Please sign in to comment.