diff --git a/storage/src/main/java/com/epam/aidial/core/storage/service/ResourceService.java b/storage/src/main/java/com/epam/aidial/core/storage/service/ResourceService.java index c57446b2..804e4c1f 100644 --- a/storage/src/main/java/com/epam/aidial/core/storage/service/ResourceService.java +++ b/storage/src/main/java/com/epam/aidial/core/storage/service/ResourceService.java @@ -349,12 +349,6 @@ public ResourceStream getResourceStream(ResourceDescriptor resource, EtagHeader String contentType = metadata.getContentMetadata().getContentType(); Long length = metadata.getContentMetadata().getContentLength(); - if (length <= maxSize) { - result = blobToResult(blob, metadata); - redisPut(key, result); - return ResourceStream.fromResult(result, etagHeader); - } - etagHeader.validate(etag); return new ResourceStream(payload.openStream(), etag, contentType, length); } @@ -391,17 +385,9 @@ private ResourceItemMetadata putResource( String newEtag = EtagBuilder.generateEtag(body); Result result = new Result(body, newEtag, createdAt, updatedAt, contentType, descriptor.getType().requireCompression(), (long) body.length, descriptor.getType().name(), false); - if (body.length <= maxSize) { - redisPut(redisKey, result); - if (metadata == null) { - String blobKey = blobKey(descriptor); - blobPut(blobKey, result.toStub()); // create an empty object for listing - } - } else { - flushToBlobStore(redisKey); - String blobKey = blobKey(descriptor); - blobPut(blobKey, result); - } + flushToBlobStore(redisKey); + String blobKey = blobKey(descriptor); + blobPut(blobKey, result); ResourceEvent.Action action = metadata == null ? ResourceEvent.Action.CREATE