diff --git a/clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult.java b/clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult.java index 5c934ab12..8601f1236 100644 --- a/clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult.java +++ b/clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult.java @@ -31,18 +31,10 @@ public class ClickHouseResult implements Result { .map(rec -> ClickHousePair.of(resp.getColumns(), rec)))) .map(pair -> new ClickHouseRow(pair.getRight(), pair.getLeft())) .map(RowSegment::new); - - this.updatedCount = Mono.using(() -> response, - resp -> Mono.just(response).map(ClickHouseResponse::getSummary) - .map(ClickHouseResponseSummary::getProgress) - .map(ClickHouseResponseSummary.Progress::getWrittenRows) - .map(UpdateCount::new), - resp -> { - if (!resp.isClosed()) { - resp.close(); - } - }); - + this.updatedCount = Mono.just(response).map(ClickHouseResponse::getSummary) + .map(ClickHouseResponseSummary::getProgress) + .map(ClickHouseResponseSummary.Progress::getWrittenRows) + .map(UpdateCount::new); this.segments = Flux.concat(this.updatedCount, this.rowSegments); } diff --git a/clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult091.java b/clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult091.java index 535ea4456..4b67bf889 100644 --- a/clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult091.java +++ b/clickhouse-r2dbc/src/main/java/com/clickhouse/r2dbc/ClickHouseResult091.java @@ -31,16 +31,10 @@ class ClickHouseResult implements Result { .map(rec -> ClickHousePair.of(resp.getColumns(), rec)))) .map(pair -> new ClickHouseRow(pair.getRight(), pair.getLeft())) .map(RowSegment::new); - this.updatedCount = Mono.using(() -> response, - resp -> Mono.just(response).map(ClickHouseResponse::getSummary) - .map(ClickHouseResponseSummary::getProgress) - .map(ClickHouseResponseSummary.Progress::getWrittenRows) - .map(UpdateCount::new), - resp -> { - if (!resp.isClosed()) { - resp.close(); - } - }); + this.updatedCount = Mono.just(response).map(ClickHouseResponse::getSummary) + .map(ClickHouseResponseSummary::getProgress) + .map(ClickHouseResponseSummary.Progress::getWrittenRows) + .map(UpdateCount::new); this.segments = Flux.concat(this.updatedCount, this.rowSegments); }