Skip to content

Commit

Permalink
validateCustomApplication moved to executeBlocking. unnecessary log r…
Browse files Browse the repository at this point in the history
…emoved.
  • Loading branch information
sergey-zinchenko committed Nov 19, 2024
1 parent 939bfc3 commit 09fe5c6
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ private void validateCustomApplication(Application application) {
Config config = context.getConfig();
List<ResourceDescriptor> files = CustomApplicationUtils.getFiles(config, application, encryptionService,
resourceService);
log.error(application.getCustomProperties().toString());
files.stream().filter(resource -> !(resourceService.hasResource(resource)
&& accessService.hasReadAccess(resource, context)))
.findAny().ifPresent(file -> {
Expand Down Expand Up @@ -225,14 +224,16 @@ private Future<?> putResource(ResourceDescriptor descriptor) {
Future<ResourceItemMetadata> responseFuture;

if (descriptor.getType() == ResourceTypes.APPLICATION) {
responseFuture = requestFuture.compose(pair -> {
responseFuture = requestFuture.compose(pair -> {
EtagHeader etag = pair.getKey();
Application application = ProxyUtil.convertToObject(pair.getValue(), Application.class);
validateCustomApplication(application);
return vertx.executeBlocking(() -> applicationService.putApplication(descriptor, etag, application).getKey(), false);
return vertx.executeBlocking(() -> {
validateCustomApplication(application);
return applicationService.putApplication(descriptor, etag, application).getKey();
}, false);
});
} else {
responseFuture = requestFuture.compose(pair -> {
responseFuture = requestFuture.compose(pair -> {
EtagHeader etag = pair.getKey();
String body = pair.getValue();
validateRequestBody(descriptor, body);
Expand Down Expand Up @@ -269,7 +270,7 @@ private Future<?> deleteResource(ResourceDescriptor descriptor) {
if (descriptor.getType() == ResourceTypes.APPLICATION) {
applicationService.deleteApplication(descriptor, etag);
} else {
deleted = resourceService.deleteResource(descriptor, etag);
deleted = resourceService.deleteResource(descriptor, etag);
}

if (!deleted) {
Expand Down

0 comments on commit 09fe5c6

Please sign in to comment.