keys stabilize
This commit is contained in:
parent
da446f5ab0
commit
0c1bee31f4
|
|
@ -376,7 +376,12 @@ async def _pick_pending(limit: int) -> List[Tuple[EncryptedContent, PlainStaging
|
|||
if not staging:
|
||||
peers = (await session.execute(select(KnownNode))).scalars().all()
|
||||
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)
|
||||
if not dek:
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import json
|
||||
from typing import Optional
|
||||
|
||||
import httpx
|
||||
|
|
|
|||
Loading…
Reference in New Issue