You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2024/03/13 13:40:37 UTC
(tika) branch TIKA-4207 updated: TIKA-4207 -- add capacity to async throttled response
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch TIKA-4207
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/TIKA-4207 by this push:
new 069b05bce TIKA-4207 -- add capacity to async throttled response
069b05bce is described below
commit 069b05bcebe991af10c924c836f8b5cb9992126a
Author: tallison <ta...@apache.org>
AuthorDate: Wed Mar 13 09:40:22 2024 -0400
TIKA-4207 -- add capacity to async throttled response
---
.../main/java/org/apache/tika/server/core/resource/AsyncResource.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/resource/AsyncResource.java b/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/resource/AsyncResource.java
index 2cc7b1294..78d29abfa 100644
--- a/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/resource/AsyncResource.java
+++ b/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/resource/AsyncResource.java
@@ -112,6 +112,7 @@ public class AsyncResource {
}
Instant start = Instant.now();
boolean offered = asyncProcessor.offer(request.getTuples(), maxQueuePauseMs);
+ asyncProcessor.getCapacity();
if (offered) {
return ok(request.getTuples().size());
} else {
@@ -130,6 +131,7 @@ public class AsyncResource {
Map<String, Object> map = new HashMap<>();
map.put("status", "throttled");
map.put("msg", "not able to receive request of size " + requestSize + " at this time");
+ map.put("capacity", asyncProcessor.getCapacity());
return map;
}