diff --git a/src/main/java/edu/harvard/mcz/imagecapture/data/NahimaManager.java b/src/main/java/edu/harvard/mcz/imagecapture/data/NahimaManager.java index 05c60cb..45c80aa 100644 --- a/src/main/java/edu/harvard/mcz/imagecapture/data/NahimaManager.java +++ b/src/main/java/edu/harvard/mcz/imagecapture/data/NahimaManager.java @@ -153,7 +153,7 @@ public ArrayList uploadImagesForSpecimen(Specimen specimen) throws I MultipartBodyPublisher multipartBody = MultipartBodyPublisher.newBuilder().filePart("image", Path.of(imagePath), MediaType.IMAGE_ANY).build(); log.debug("Built multipart body..."); MutableRequest request = MutableRequest.POST(queryUrl, multipartBody).header("Content-Disposition", "attachment; filename=\"" + image.getFilename() + "\""); - log.debug("Built request to uplaod..."); + log.debug("Built request to upload..."); HttpResponse response = httpClient.send(request, HttpResponse.BodyHandlers.ofString()); log.debug("Response from uploading image: " + response.body()); diff --git a/src/main/java/edu/harvard/mcz/imagecapture/utility/AbstractRestClient.java b/src/main/java/edu/harvard/mcz/imagecapture/utility/AbstractRestClient.java index 70c6e80..4faec1f 100644 --- a/src/main/java/edu/harvard/mcz/imagecapture/utility/AbstractRestClient.java +++ b/src/main/java/edu/harvard/mcz/imagecapture/utility/AbstractRestClient.java @@ -31,11 +31,11 @@ public abstract class AbstractRestClient { public AbstractRestClient() { Methanol.Builder builder = Methanol.newBuilder() .userAgent("DataShot " + ImageCaptureApp.getAppVersion()) - .requestTimeout(Duration.ofSeconds(60)) // Default request timeout - .headersTimeout(Duration.ofSeconds(30)) // Timeout for receiving response headers - .readTimeout(Duration.ofSeconds(30)); // Timeout for single reads; - httpClient = builder.executor(Executors.newFixedThreadPool(4)) - .connectTimeout(Duration.ofSeconds(60)) + .requestTimeout(Duration.ofSeconds(360)) // Default request timeout + .headersTimeout(Duration.ofSeconds(120)) // Timeout for receiving response headers + .readTimeout(Duration.ofSeconds(60)); // Timeout for single reads; + httpClient = builder.executor(Executors.newFixedThreadPool(8)) + .connectTimeout(Duration.ofSeconds(120)) .build(); }