diff --git a/server/src/adsb.mjs b/server/src/adsb.mjs index bd657cc..2a0cd45 100644 --- a/server/src/adsb.mjs +++ b/server/src/adsb.mjs @@ -233,7 +233,10 @@ export async function enrichAircraft(a) { // 2. Race the two external sources if(noRecord.includes(icao)) return { icao, ...a, type: 'unknown' }; - let found = scrapeHexDatabase(icao); + const hexDbPromise = fetchHexDb(icao); + const scrapePromise = scrapeHexDatabase(icao); + let found = await hexDbPromise; + if(!found) found = await scrapePromise; if(!found) { noRecord.push(icao); return { icao, ...a, type: 'unknown' };