keys stabilize

This commit is contained in:
unexpected 2025-10-09 18:28:30 +00:00
parent da446f5ab0
commit 0c1bee31f4
2 changed files with 7 additions and 1 deletions

View File

@ -376,7 +376,12 @@ async def _pick_pending(limit: int) -> List[Tuple[EncryptedContent, PlainStaging
if not staging: if not staging:
peers = (await session.execute(select(KnownNode))).scalars().all() peers = (await session.execute(select(KnownNode))).scalars().all()
for peer in peers: for peer in peers:
base_url = f"http://{peer.ip}:{peer.port}" meta = peer.meta or {}
public_host = meta.get('public_host')
if not public_host:
last_resp = (meta.get('last_response') or {}).get('node', {}) if isinstance(meta, dict) else {}
public_host = last_resp.get('public_host')
base_url = public_host or f"http://{peer.ip}:{peer.port}"
dek = await request_key_from_peer(base_url, ec.encrypted_cid) dek = await request_key_from_peer(base_url, ec.encrypted_cid)
if not dek: if not dek:
continue continue

View File

@ -1,6 +1,7 @@
from __future__ import annotations from __future__ import annotations
import base64 import base64
import json
from typing import Optional from typing import Optional
import httpx import httpx