ADSB backfill fix?
This commit is contained in:
@@ -234,8 +234,14 @@ 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),
|
||||
scrapeHexDatabase(icao),
|
||||
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);
|
||||
if(!found) {
|
||||
noRecord.push(icao);
|
||||
|
||||
Reference in New Issue
Block a user