This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 62cc883cea2f86486f80b3e9b02b24e515fd1efd
Author: Benoit Tellier <[email protected]>
AuthorDate: Fri Nov 26 17:38:03 2021 +0700

    JAMES-3676 S3BlobStoreDAO::read (input stream) avoid a double nested block
    
    Block sequentially instead. This mobilises one thread instead of two.
---
 .../org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java
 
b/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java
index ce2d00d..66097a9 100644
--- 
a/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java
+++ 
b/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java
@@ -159,12 +159,12 @@ public class S3BlobStoreDAO implements BlobStoreDAO, 
Startable, Closeable {
     public InputStream read(BucketName bucketName, BlobId blobId) throws 
ObjectStoreIOException, ObjectNotFoundException {
         BucketName resolvedBucketName = bucketNameResolver.resolve(bucketName);
 
-        return getObject(resolvedBucketName, blobId)
-            .publishOn(Schedulers.elastic())
-            .map(response -> ReactorUtils.toInputStream(response.flux))
+
+        return ReactorUtils.toInputStream(getObject(resolvedBucketName, blobId)
             .onErrorMap(NoSuchBucketException.class, e -> new 
ObjectNotFoundException("Bucket not found " + resolvedBucketName.asString(), e))
             .onErrorMap(NoSuchKeyException.class, e -> new 
ObjectNotFoundException("Blob not found " + resolvedBucketName.asString(), e))
-            .block();
+            .block()
+            .flux);
     }
 
     private static class FluxResponse {

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to