修复关注
This commit is contained in:
+3
-2
@@ -7,6 +7,7 @@ import {
|
||||
import {
|
||||
actorCacheStale,
|
||||
deleteActorFromCache,
|
||||
ensureActorLocalId,
|
||||
getActorByKeyId,
|
||||
getActorFromCache,
|
||||
recordNotification,
|
||||
@@ -21,9 +22,9 @@ const ACTIVITY_HEADERS = "application/activity+json, application/ld+json; profil
|
||||
export async function resolveRemoteActor(env: Env, actorId: string, opts: { force?: boolean } = {}): Promise<ActorCache | null> {
|
||||
if (!actorId) return null;
|
||||
const cached = await getActorFromCache(env, actorId);
|
||||
if (cached && !opts.force && !actorCacheStale(cached)) return cached;
|
||||
if (cached && !opts.force && !actorCacheStale(cached)) return ensureActorLocalId(env, cached);
|
||||
const fetched = await fetchRemoteActor(actorId);
|
||||
if (!fetched) return cached;
|
||||
if (!fetched) return cached ? ensureActorLocalId(env, cached) : null;
|
||||
return upsertActorCache(env, fetched);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user