Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed May 10, 2022
1 parent 1c3c3bd commit ff93385
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,17 +327,18 @@ private void updateBuilderAvailability() {
.finish(
statusResponse -> {
if (statusResponse.getErrorMessage() != null) {
latestBuilderAvailability.set(false);
eventLogger.executionBuilderIsOffline(statusResponse.getErrorMessage());
markBuilderAsNotAvailable(statusResponse.getErrorMessage());
} else {
if (latestBuilderAvailability.compareAndSet(false, true)) {
eventLogger.executionBuilderIsBackOnline();
}
}
},
throwable -> {
latestBuilderAvailability.set(false);
eventLogger.executionBuilderIsOffline(throwable.getMessage());
});
throwable -> markBuilderAsNotAvailable(throwable.getMessage()));
}

private void markBuilderAsNotAvailable(String errorMessage) {
latestBuilderAvailability.set(false);
eventLogger.executionBuilderIsOffline(errorMessage);
}
}

0 comments on commit ff93385

Please sign in to comment.