Commit 1fbd1b59 authored by Rachel Wong's avatar Rachel Wong Committed by Commit Bot

Push HTTP requests to front of the queue rather than the end.

This is because we should retrieve the oldest requests from the end of
the queue.

Bug: 916420
Change-Id: I0232eb73d2c922297833a93adb22da39c91047e2
Reviewed-on: https://chromium-review.googlesource.com/c/1493339Reviewed-by: default avatarMichael Martis <martis@chromium.org>
Commit-Queue: Rachel Wong <wrong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636681}
parent 4411acbd
......@@ -420,7 +420,7 @@ void Annotator::OnJpgImageDataReceived(
local_processors_.erase(source_id);
// Schedule an HTTP request for this image.
http_request_queue_.push_back({source_id, image_bytes});
http_request_queue_.push_front({source_id, image_bytes});
pending_source_ids_.insert(source_id);
// Start sending batches to the server.
......
......@@ -64,8 +64,8 @@ constexpr char kBatchRequest[] = R"(
{
"imageRequests": [
{
"imageId": "https://www.example.com/image1.jpg",
"imageBytes": "AQID",
"imageId": "https://www.example.com/image3.jpg",
"imageBytes": "BwgJ",
"engineParameters": [
{"ocrParameters": {}},
{"descriptionParameters": {}}
......@@ -80,8 +80,8 @@ constexpr char kBatchRequest[] = R"(
]
},
{
"imageId": "https://www.example.com/image3.jpg",
"imageBytes": "BwgJ",
"imageId": "https://www.example.com/image1.jpg",
"imageBytes": "AQID",
"engineParameters": [
{"ocrParameters": {}},
{"descriptionParameters": {}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment