aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-10-14 10:34:33 +0200
committerJon Marius Venstad <venstad@gmail.com>2020-10-14 10:34:33 +0200
commitc430a9ed1a8afaeae4b96a7df18a056bfd13a437 (patch)
tree954af349ccf4ad4fb52b36fdf12b5e3c7b9bad29 /vespaclient-container-plugin
parent78fa36414d239450a4e7da3919c74a16452bf52f (diff)
Simpifly enqueue-dispatch
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java
index d5cd685cf2d..df837970168 100644
--- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java
+++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java
@@ -408,13 +408,8 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler {
overload(request, "Rejecting execution due to overload: " + maxThrottled + " requests already enqueued", handler);
return;
}
- Operation operation = Operation.lazilyParsed(request, handler, operationParser);
- if (enqueued.get() == 1 && operation.dispatch()) // Bypass queue if it is empty.
- enqueued.decrementAndGet();
- else {
- operations.offer(operation);
- dispatchFirst();
- }
+ operations.offer(Operation.lazilyParsed(request, handler, operationParser));
+ dispatchFirst();
}