Skip to content

Commit

Permalink
set module started at applicationDeployer checkStarted() (#9013)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrlw authored Oct 12, 2021
1 parent e676350 commit 1dc1822
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public interface ApplicationDeployer extends Deployer<ApplicationModel> {

void checkStarting();

void checkStarted();
void checkStarted(CompletableFuture checkerStartFuture);

}
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ public void checkStarting() {
}

@Override
public void checkStarted() {
public void checkStarted(CompletableFuture checkerStartFuture) {
for (ModuleModel moduleModel : applicationModel.getModuleModels()) {
if (moduleModel.getDeployer().isPending()) {
setPending();
Expand All @@ -839,7 +839,7 @@ public void checkStarted() {
}
}
// all modules has been started
onStarted();
onStarted(checkerStartFuture);
}

private void onStarting() {
Expand All @@ -849,14 +849,17 @@ private void onStarting() {
}
}

private void onStarted() {
private void onStarted(CompletableFuture checkerStartFuture) {
setStarted();
if (logger.isInfoEnabled()) {
logger.info(getIdentifier() + " is ready.");
}
if (startFuture != null) {
startFuture.complete(true);
}
if (checkerStartFuture != null) {
checkerStartFuture.complete(true);
}
}

private void onStopping() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ private void onModuleStarting() {
private void onModuleStarted(CompletableFuture startFuture) {
setStarted();
logger.info(getIdentifier() + " has started.");
startFuture.complete(true);
applicationDeployer.checkStarted();
applicationDeployer.checkStarted(startFuture);
}

private void onModuleStopping() {
Expand Down

0 comments on commit 1dc1822

Please sign in to comment.