hungphan227 commented on PR #2190: URL: https://github.com/apache/james-project/pull/2190#issuecomment-2081828101
> And do this sort out the paging problem? > > IE can we remove the very dirty .collectList ? I you mean this: ``` public Flux<Record> executeDeleteAndReturnList(Function<DSLContext, DeleteResultStep<Record>> queryFunction) { return Flux.from(metricFactory.decoratePublisherWithTimerMetric("postgres-execution", Flux.usingWhen(jamesPostgresConnectionFactory.getConnection(domain), connection -> dslContext(connection) .flatMapMany(queryFunction) .timeout(postgresConfiguration.getJooqReactiveTimeout()) .doOnError(TimeoutException.class, e -> LOGGER.error(JOOQ_TIMEOUT_ERROR_LOG, e)) **.collectList()** .flatMapIterable(list -> list) // The convert Flux -> Mono<List> -> Flux to avoid a hanging issue. See: https://github.com/jOOQ/jOOQ/issues/16055 .retryWhen(Retry.backoff(MAX_RETRY_ATTEMPTS, MIN_BACKOFF) .filter(preparedStatementConflictException())), jamesPostgresConnectionFactory::closeConnection))); ``` Yes we can -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org