Fix: Ortsnamen-Layer, InfoBox bei Klick, globale Flugabdeckung
Ortsnamen: Esri World Boundaries als zuschaltbarer Imagery-Layer. InfoBox: CSS-Ausblendung entfernt, Dark-Theme Styling. Flugverkehr: Batch-Groesse 3, Pause 3s, zufaellige Reihenfolge — alle Regionen bekommen Daten statt nur Europa.
Dieser Commit ist enthalten in:
@@ -27,10 +27,12 @@ _lock = asyncio.Lock()
|
||||
_task = None
|
||||
|
||||
|
||||
import random
|
||||
|
||||
async def _fetch_all():
|
||||
"""Holt Flugdaten fuer alle Stuetzpunkte."""
|
||||
now = time.time()
|
||||
if _cache["data"] and now - _cache["ts"] < 25:
|
||||
if _cache["data"] and now - _cache["ts"] < 45:
|
||||
return _cache["data"]
|
||||
|
||||
async with _lock:
|
||||
@@ -39,9 +41,11 @@ async def _fetch_all():
|
||||
|
||||
seen = {}
|
||||
errors = 0
|
||||
grid = list(_GRID)
|
||||
random.shuffle(grid)
|
||||
async with httpx.AsyncClient(timeout=10) as client:
|
||||
for i in range(0, len(_GRID), 10):
|
||||
batch = _GRID[i:i+10]
|
||||
for i in range(0, len(grid), 3):
|
||||
batch = grid[i:i+3]
|
||||
tasks = [client.get(f"https://api.airplanes.live/v2/point/{lat:.2f}/{lon:.2f}/250")
|
||||
for lat, lon in batch]
|
||||
results = await asyncio.gather(*tasks, return_exceptions=True)
|
||||
@@ -56,8 +60,8 @@ async def _fetch_all():
|
||||
seen[h] = ac
|
||||
except Exception:
|
||||
errors += 1
|
||||
if i + 10 < len(_GRID):
|
||||
await asyncio.sleep(0.2)
|
||||
if i + 3 < len(grid):
|
||||
await asyncio.sleep(3.0)
|
||||
|
||||
_cache["data"] = {"ac": list(seen.values()), "total": len(seen), "errors": errors}
|
||||
_cache["ts"] = time.time()
|
||||
@@ -73,7 +77,7 @@ async def _collector_loop():
|
||||
await _fetch_all()
|
||||
except Exception as e:
|
||||
logger.warning(f"Flight collector error: {e}")
|
||||
await asyncio.sleep(30)
|
||||
await asyncio.sleep(60)
|
||||
|
||||
|
||||
def start_flight_collector():
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren