Force refresh actor once in a while

This commit is contained in:
Thomas Sileo 2022-10-07 08:55:05 +02:00
parent c8a9793638
commit f6cfe06f66
2 changed files with 41 additions and 18 deletions

View file

@ -1492,6 +1492,7 @@ async def _handle_update_activity(
# Update the actor
from_actor.ap_actor = updated_actor.ap_actor
from_actor.updated_at = now()
elif (ap_type := wrapped_object["type"]) in [
"Question",
"Note",
@ -1514,6 +1515,7 @@ async def _handle_update_activity(
# Everything looks correct, update the object in the inbox
logger.info(f"Updating {existing_object.ap_id}")
existing_object.ap_object = wrapped_object
existing_object.updated_at = now()
else:
# TODO(ts): support updating objects
logger.info(f'Cannot update {wrapped_object["type"]}')