Skip to content

Commit

Permalink
getCustomApplicationMetaSchema calls inside executeBlocking in AppSch…
Browse files Browse the repository at this point in the history
…emasController
  • Loading branch information
sergey-zinchenko committed Nov 19, 2024
1 parent 8987d4a commit 2e9628c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.vertx.core.Future;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpServerRequest;
import lombok.extern.slf4j.Slf4j;

Expand All @@ -22,9 +23,11 @@
@Slf4j
public class AppSchemasController implements Controller {
private final ProxyContext context;
private final Vertx vertx;

public AppSchemasController(ProxyContext context) {
this.context = context;
this.vertx = context.getProxy().getVertx();
}

private static final String LIST_SCHEMAS_RELATIVE_PATH = "list";
Expand All @@ -48,7 +51,8 @@ public Future<?> handle() {

private Future<?> handleGetMetaSchema() {
try {
return context.respond(HttpStatus.OK, MetaSchemaHolder.getCustomApplicationMetaSchema());
return vertx.executeBlocking(MetaSchemaHolder::getCustomApplicationMetaSchema)
.onSuccess(metaSchema -> context.respond(HttpStatus.OK, metaSchema));
} catch (Throwable e) {
log.error(FAILED_READ_META_SCHEMA_MESSAGE, e);
return context.respond(HttpStatus.INTERNAL_SERVER_ERROR, FAILED_READ_META_SCHEMA_MESSAGE);
Expand Down

0 comments on commit 2e9628c

Please sign in to comment.