limit the number of player names resolved in one go, to prevent excessive requests
for #656 number 4
This commit is contained in:
parent
44ee4c7200
commit
1501f98f9b
@ -66,6 +66,12 @@ window.resolvePlayerNames = function() {
|
||||
//limit per request. stock site is never more than 13 (8 res, 4 mods, owner)
|
||||
//testing shows 15 works and 20 fails
|
||||
var MAX_RESOLVE_PLAYERS_PER_REQUEST = 15;
|
||||
var MAX_RESOLVE_REQUESTS = 8;
|
||||
|
||||
if (window.playersToResolve.length > MAX_RESOLVE_PLAYERS_PER_REQUEST*MAX_RESOLVE_REQUESTS) {
|
||||
console.log('Warning: player name resolve queue had '+window.playersToResolve.length+' entries. Limiting to the first '+MAX_RESOLVE_PLAYERS_PER_REQUEST*MAX_RESOLVE_REQUESTS+' to prevent excessive requests');
|
||||
window.playersToResolve = playersToResolve.slice(0,MAX_RESOLVE_PLAYERS_PER_REQUEST*MAX_RESOLVE_REQUESTS);
|
||||
}
|
||||
|
||||
var p = window.playersToResolve.slice(0,MAX_RESOLVE_PLAYERS_PER_REQUEST);
|
||||
window.playersToResolve = playersToResolve.slice(MAX_RESOLVE_PLAYERS_PER_REQUEST);
|
||||
|
Loading…
x
Reference in New Issue
Block a user