Improve actor caching
This commit is contained in:
parent
b6751f511a
commit
9aa1f67e28
4 changed files with 56 additions and 44 deletions
|
@ -121,15 +121,9 @@ def _announce_process_inbox(announce: ap.Announce, new_meta: _NewMeta) -> None:
|
|||
if obj.has_type(ap.ActivityType.QUESTION):
|
||||
Tasks.fetch_remote_question(obj)
|
||||
|
||||
update_one_activity(
|
||||
by_remote_id(announce.id),
|
||||
upsert(
|
||||
{
|
||||
MetaKey.OBJECT: obj.to_dict(embed=True),
|
||||
MetaKey.OBJECT_ACTOR: obj.get_actor().to_dict(embed=True),
|
||||
}
|
||||
),
|
||||
)
|
||||
# Cache the announced object
|
||||
Tasks.cache_object(announce.id)
|
||||
|
||||
update_one_activity(
|
||||
{**by_type(ap.ActivityType.CREATE), **by_object_id(obj.id)},
|
||||
inc(MetaKey.COUNT_BOOST, 1),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue