Skip to content

Commit

Permalink
Improve logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
ekharkunov committed Aug 14, 2024
1 parent 3ba048e commit 0477ec2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public GCPInstanceService(RemoteHostConfiguration remoteHostConfiguration) throw
}

private void suspendInstance(final String instanceId) throws InterruptedException, ExecutionException, TimeoutException {
LOGGER.info(String.format("Try suspend VM '%s'", instanceId));
int attemptCount = 0;
while (true) {
Operation response = instancesClient.suspendAsync(projectId, computeZone, instanceId).get(operationWaitTimeout, TimeUnit.MILLISECONDS);
Expand All @@ -65,7 +66,8 @@ private void suspendInstance(final String instanceId) throws InterruptedExceptio
}
}

public void resumeInstance(String instanceId) throws InterruptedException, ExecutionException, TimeoutException {
private void resumeInstance(String instanceId) throws InterruptedException, ExecutionException, TimeoutException {
LOGGER.info(String.format("Try resume VM '%s'", instanceId));
int attemptCount = 0;
while (true) {
Operation response = instancesClient.resumeAsync(projectId, computeZone, instanceId).get(operationWaitTimeout, TimeUnit.MILLISECONDS);
Expand Down Expand Up @@ -119,7 +121,6 @@ public void checkInstancesState() {
} catch(ExecutionException exc) {
LOGGER.error(String.format("Suspend '%s' failed.", entry.getKey()), exc);
}

}
}
}
Expand Down

0 comments on commit 0477ec2

Please sign in to comment.