fix(ocr): increase presigned URL TTL from 15 min to 1 hour

A 100-page document at ~10 s/page takes ~17 min on CPU-only hardware,
which could cause the presigned URL to expire mid-OCR job. 1 hour gives
ample headroom for any realistic document size in this archive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-13 23:00:52 +02:00
parent 2181fe0b50
commit 2b355e748e

View File

@@ -114,7 +114,8 @@ public class FileService {
/**
* Generates a presigned URL for downloading an object from S3/MinIO.
* Valid for 15 minutes — enough for OCR processing on CPU.
* Valid for 1 hour — covers multi-page documents on CPU-only OCR hardware
* (a 100-page document at 10 s/page takes ~17 min; 1 h gives ample headroom).
*/
public String generatePresignedUrl(String s3Key) {
GetObjectRequest getObjectRequest = GetObjectRequest.builder()
@@ -123,7 +124,7 @@ public class FileService {
.build();
GetObjectPresignRequest presignRequest = GetObjectPresignRequest.builder()
.signatureDuration(Duration.ofMinutes(15))
.signatureDuration(Duration.ofHours(1))
.getObjectRequest(getObjectRequest)
.build();