"""Una ejecucion del rastreo; programar desde Cron cada 6 horas."""
from pathlib import Path
import sys
ROOT = Path(__file__).resolve().parent
sys.path.insert(0, str(ROOT))
import radar_server
radar_server.load_state()
radar_server.refresh_all()
print("Actualizacion completada:", radar_server.STATE.get("last_refresh"))
print("Fuentes activas:", sum(1 for s in radar_server.STATE.get("sources", {}).values() if s.get("ok")))
print("Avisos guardados:", len(radar_server.STATE.get("listings", {})))
