ADSB backfill fix?
This commit is contained in:
@@ -234,8 +234,14 @@ export async function enrichAircraft(a) {
|
|||||||
// 2. Race the two external sources
|
// 2. Race the two external sources
|
||||||
if(noRecord.includes(icao)) return { icao, ...a, type: 'unknown' };
|
if(noRecord.includes(icao)) return { icao, ...a, type: 'unknown' };
|
||||||
let found = await Promise.any([
|
let found = await Promise.any([
|
||||||
fetchHexDb(icao),
|
fetchHexDb(icao).then(resp => {
|
||||||
scrapeHexDatabase(icao),
|
if(resp) console.log(`Source1: ${icao}`)
|
||||||
|
return resp;
|
||||||
|
}),
|
||||||
|
scrapeHexDatabase(icao).then(resp => {
|
||||||
|
if(resp) console.log(`Source2: ${icao}`)
|
||||||
|
return resp;
|
||||||
|
}),
|
||||||
]).catch(() => null);
|
]).catch(() => null);
|
||||||
if(!found) {
|
if(!found) {
|
||||||
noRecord.push(icao);
|
noRecord.push(icao);
|
||||||
|
|||||||
Reference in New Issue
Block a user