Skip to content

Commit

Permalink
#1877 sleep longer
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Feb 27, 2024
1 parent 2282ae7 commit df9b9d5
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/main/java/com/rultor/agents/aws/StartsInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,7 @@ private Instance run(final String talk) {
if ("running".equals(state.getName())) {
break;
}
try {
Thread.sleep(TimeUnit.SECONDS.toMillis(4L));
} catch (final InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IllegalStateException(ex);
}
StartsInstance.sleep(5L);
}
final Instance ready = this.api.aws().describeInstances(
new DescribeInstancesRequest()
Expand All @@ -205,6 +200,20 @@ private Instance run(final String talk) {
this, "AWS instance %s launched and running at %s",
ready.getInstanceId(), ready.getPublicIpAddress()
);
StartsInstance.sleep(30L);
return ready;
}

/**
* Sleep for a while.
* @param seconds Seconds
*/
private static void sleep(final long seconds) {
try {
Thread.sleep(TimeUnit.SECONDS.toMillis(seconds));
} catch (final InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IllegalStateException(ex);
}
}
}

0 comments on commit df9b9d5

Please sign in to comment.