more tweaks to the request code

- delay briefly before retrying a timeout, and a bit longer before other errors
- also delay briefly before running the queue after a request, to give a chance of more than one request's requeued entries being handled atr once
- add a min tiles per request, to avoid sending multiple requests when only a few queued items remain
these are attempts to be nicer to the niantic servers, particularly in error cases, with some based on my best guess of the stock site behaviour, and others based on what seems reasonable to me
This commit is contained in:
Jon Atkins
2013-09-06 22:32:57 +01:00
parent 960f3ea29d
commit b83cf459c8
2 changed files with 80 additions and 23 deletions

View File

@ -34,8 +34,8 @@ window.RenderDebugTiles.prototype.setColour = function(id,bordercol,fillcol) {
}
window.RenderDebugTiles.prototype.setState = function(id,state) {
var col = '#666';
var fill = '#666';
var col = '#f0f';
var fill = '#f0f';
switch(state) {
case 'ok': col='#0f0'; fill='#0f0'; break;
case 'error': col='#f00'; fill='#f00'; break;
@ -43,6 +43,9 @@ window.RenderDebugTiles.prototype.setState = function(id,state) {
case 'cache-stale': col='#f00'; fill='#ff0'; break;
case 'requested': col='#66f'; fill='#66f'; break;
case 'retrying': col='#666'; fill='#666'; break;
case 'request-fail': col='#a00'; fill='#666'; break;
case 'tile-fail': col='#f00'; fill='#666'; break;
case 'tile-timeout': col='#ff0'; fill='#666'; break;
}
this.setColour (id, col, fill);
}