From f96aab03dc58dbc683ec2ccc2c310e62af98fe8c Mon Sep 17 00:00:00 2001 From: Timo Tiuraniemi Date: Tue, 22 Dec 2020 11:03:55 +0200 Subject: [PATCH] Move blocking handling to the right level in the maintenance resource --- .../io/nflow/rest/v1/springweb/MaintenanceResource.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nflow-rest-api-spring-web/src/main/java/io/nflow/rest/v1/springweb/MaintenanceResource.java b/nflow-rest-api-spring-web/src/main/java/io/nflow/rest/v1/springweb/MaintenanceResource.java index c857046e5..d374ec72a 100644 --- a/nflow-rest-api-spring-web/src/main/java/io/nflow/rest/v1/springweb/MaintenanceResource.java +++ b/nflow-rest-api-spring-web/src/main/java/io/nflow/rest/v1/springweb/MaintenanceResource.java @@ -46,11 +46,11 @@ public MaintenanceResource(SchedulerService scheduler, MaintenanceService mainte @ApiOperation(value = "Do maintenance on old workflow instances synchronously", response = MaintenanceResponse.class) public Mono> cleanupWorkflows( @RequestBody @ApiParam(value = "Parameters for the maintenance process", required = true) MaintenanceRequest request) { - return handleExceptions(() -> { + return handleExceptions(() -> wrapBlocking(() -> { MaintenanceConfiguration configuration = converter.convert(request); MaintenanceResults results = maintenanceService.cleanupWorkflows(configuration); - return wrapBlocking(() -> ok(converter.convert(results))); - }); + return ok(converter.convert(results)); + })); } }