Update modules/visual_route.py

This commit is contained in:
Blackwhitebear8 2025-08-13 18:28:21 +02:00
parent a8802d6e05
commit 0804f6b22a

View file

@ -21,7 +21,6 @@ ROUTER_NAME = os.getenv('BGP_VIS_ROUTER_NAME', 'My Router')
def _bulk_get_as_names(asn_numbers: list[str]): def _bulk_get_as_names(asn_numbers: list[str]):
lookup_list = [asn for asn in asn_numbers if asn not in AS_NAME_CACHE] lookup_list = [asn for asn in asn_numbers if asn not in AS_NAME_CACHE]
if not lookup_list: return if not lookup_list: return
print(f"Performing bulk lookup for {len(lookup_list)} AS numbers...")
query = "begin\n" + "\n".join(f"AS{asn}" for asn in lookup_list) + "\nend\n" query = "begin\n" + "\n".join(f"AS{asn}" for asn in lookup_list) + "\nend\n"
try: try:
with socket.create_connection(('bgp.tools', 43), timeout=10) as s: with socket.create_connection(('bgp.tools', 43), timeout=10) as s: