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