mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 14:38:00 +00:00
actor: cleanly catch exceptions while delivering messages
This commit is contained in:
parent
ccd0e12b0a
commit
e0d633b861
|
@ -93,12 +93,15 @@ async def push_message_to_actor(actor, message, our_key_id):
|
||||||
|
|
||||||
logging.debug('%r >> %r', inbox, message)
|
logging.debug('%r >> %r', inbox, message)
|
||||||
|
|
||||||
async with aiohttp.ClientSession(trace_configs=[http_debug()]) as session:
|
try:
|
||||||
async with session.post(inbox, data=data, headers=headers) as resp:
|
async with aiohttp.ClientSession(trace_configs=[http_debug()]) as session:
|
||||||
if resp.status == 202:
|
async with session.post(inbox, data=data, headers=headers) as resp:
|
||||||
return
|
if resp.status == 202:
|
||||||
resp_payload = await resp.text()
|
return
|
||||||
logging.debug('%r >> resp %r', inbox, resp_payload)
|
resp_payload = await resp.text()
|
||||||
|
logging.debug('%r >> resp %r', inbox, resp_payload)
|
||||||
|
except Exception as e:
|
||||||
|
logging.info('Caught %r while pushing to %r.', e, inbox)
|
||||||
|
|
||||||
|
|
||||||
async def follow_remote_actor(actor_uri):
|
async def follow_remote_actor(actor_uri):
|
||||||
|
|
Loading…
Reference in a new issue