From 6c151d285fe8833451dbc11c19da34b3ac4e0732 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Tue, 15 Jun 2021 15:49:17 +0200 Subject: [PATCH] allow longer for regIcao download --- html/script.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/html/script.js b/html/script.js index cc3698b..a75d780 100644 --- a/html/script.js +++ b/html/script.js @@ -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) {