from repositories.proxy import list_proxies, update_proxy_runtime from services.mitmproxy.manager import manager async def reconcile_runtime() -> list[tuple[int, dict[str, object]]]: changes: list[tuple[int, dict[str, object]]] = [] for proxy in await list_proxies(): updates = await manager.reconcile(proxy) if updates is None: continue await update_proxy_runtime(proxy.proxy_port, updates) changes.append((proxy.proxy_port, updates)) return changes