Function lemmy_apub::fetcher::get_or_fetch_and_upsert_actor[][src]

pub async fn get_or_fetch_and_upsert_actor(
    apub_id: &Url,
    context: &LemmyContext,
    recursion_counter: &mut i32
) -> Result<Box<dyn ActorType>, LemmyError>
Expand description

Get a remote actor from its apub ID (either a person or a community). Thin wrapper around get_or_fetch_and_upsert_person() and get_or_fetch_and_upsert_community().

If it exists locally and !should_refetch_actor(), it is returned directly from the database. Otherwise it is fetched from the remote instance, stored and returned.