Store AS organization in geo_names

This commit is contained in:
nymkappa
2022-07-12 12:12:10 +02:00
parent 47ad5fffc8
commit 3d2ff7ef62
2 changed files with 12 additions and 1 deletions

View File

@@ -52,6 +52,13 @@ export async function $lookupNodeLocation(): Promise<void> {
`INSERT IGNORE INTO geo_names (id, type, names) VALUES (?, 'city', ?)`,
[city.city?.geoname_id, JSON.stringify(city.city?.names)]);
}
// Store AS name
if (asn.autonomous_system_organization) {
await DB.query(
`INSERT IGNORE INTO geo_names (id, type, names) VALUES (?, 'as_organization', ?)`,
[asn.autonomous_system_number, JSON.stringify(asn.autonomous_system_organization)]);
}
}
}
}