allow longer for regIcao download

This commit is contained in:
Matthias Wirth
2021-06-15 15:49:17 +02:00
parent 22ee5d43e8
commit 6c151d285f

View File

@@ -4696,6 +4696,7 @@ function processURLParams(){
}
}
let regIcaoDownloadRunning = false;
function findPlanes(query, byIcao, byCallsign, byReg, byType) {
if (query == null)
return;
@@ -4708,10 +4709,11 @@ function findPlanes(query, byIcao, byCallsign, byReg, byType) {
selectPlaneByHex(regCache[upper].toLowerCase(), {noDeselect: true, follow: true});
return;
}
} else {
} else if (!regIcaoDownloadRunning) {
regIcaoDownloadRunning = true;
let req = jQuery.ajax({ url: databaseFolder + "/regIcao.js",
cache: true,
timeout: 10000,
timeout: 60000,
dataType : 'json',
upper: `${upper}`,
});
@@ -4722,6 +4724,9 @@ function findPlanes(query, byIcao, byCallsign, byReg, byType) {
return;
}
});
req.always(function() {
regIcaoDownloadRunning = false;
});
}
}
for (let i in PlanesOrdered) {