Compute delay from request issue, not response return. Fixes #721
This commit is contained in:
parent
4a5d3d4662
commit
000c0a38a8
@ -222,6 +222,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat
|
|||||||
List<CellAtRow> responseBodies = new ArrayList<CellAtRow>(urls.size());
|
List<CellAtRow> responseBodies = new ArrayList<CellAtRow>(urls.size());
|
||||||
for (int i = 0; i < urls.size(); i++) {
|
for (int i = 0; i < urls.size(); i++) {
|
||||||
CellAtRow urlData = urls.get(i);
|
CellAtRow urlData = urls.get(i);
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
CellAtRow cellAtRow = fetch(urlData);
|
CellAtRow cellAtRow = fetch(urlData);
|
||||||
if (cellAtRow != null) {
|
if (cellAtRow != null) {
|
||||||
responseBodies.add(cellAtRow);
|
responseBodies.add(cellAtRow);
|
||||||
@ -229,7 +230,10 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat
|
|||||||
|
|
||||||
_progress = i * 100 / urls.size();
|
_progress = i * 100 / urls.size();
|
||||||
try {
|
try {
|
||||||
Thread.sleep(_delay);
|
long delay = _delay - (System.currentTimeMillis() - start);
|
||||||
|
if (delay > 0) {
|
||||||
|
Thread.sleep(delay);
|
||||||
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
if (_canceled) {
|
if (_canceled) {
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user