Skip to content

Commit

Permalink
Fixed errors in log
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Kruger <[email protected]>
  • Loading branch information
phillip-kruger committed Jun 2, 2023
1 parent cf7ab81 commit cf4e2e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.IOException;
import java.io.StringWriter;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;

import com.fasterxml.jackson.databind.ObjectMapper;

Expand All @@ -22,6 +23,8 @@
import io.quarkus.devui.runtime.continuoustesting.ContinuousTestingRecorder;
import io.quarkus.devui.spi.JsonRPCProvidersBuildItem;
import io.quarkus.devui.spi.page.Page;
import io.smallrye.mutiny.Uni;
import io.smallrye.mutiny.infrastructure.Infrastructure;

/**
* This creates Continuous Testing Page
Expand Down Expand Up @@ -93,7 +96,14 @@ private void registerStartMethod(LaunchModeBuildItem launchModeBuildItem) {
if (testSupport.isStarted()) {
return false; // Already running
} else {
testSupport.start();
CompletableFuture<Void> start = CompletableFuture.runAsync(() -> testSupport.start());
Uni.createFrom().completionStage(start).runSubscriptionOn(Infrastructure.getDefaultExecutor()).subscribe();

// Supplier<Void> startSupplier = () -> {
// testSupport.start();
// return null;
// };
// Uni.createFrom().item(startSupplier).runSubscriptionOn(Infrastructure.getDefaultExecutor()).subscribe();
return true;
}
} catch (Exception e) {
Expand Down Expand Up @@ -203,4 +213,4 @@ private void registerGetResultsMethod(LaunchModeBuildItem launchModeBuildItem) {
private static final String NAMESPACE = "devui-continuous-testing";
private static final String DASH = "-";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private void route(JsonRpcRequest jsonRpcRequest, ServerWebSocket s) {
}
uni.subscribe()
.with(item -> {
if (JsonRpcMessage.class.isAssignableFrom(item.getClass())) {
if (item != null && JsonRpcMessage.class.isAssignableFrom(item.getClass())) {
JsonRpcMessage jsonRpcMessage = (JsonRpcMessage) item;
codec.writeResponse(s, jsonRpcRequest.getId(), jsonRpcMessage.getResponse(),
jsonRpcMessage.getMessageType());
Expand Down

0 comments on commit cf4e2e1

Please sign in to comment.