Fix deleting not found remote actors
This commit is contained in:
parent
b5487ff4a5
commit
699b059e2d
|
@ -211,7 +211,14 @@ async function refreshActorIfNeeded (
|
||||||
const actor = fetchedType === 'all' ? actorArg : await ActorModel.loadByUrlAndPopulateAccountAndChannel(actorArg.url)
|
const actor = fetchedType === 'all' ? actorArg : await ActorModel.loadByUrlAndPopulateAccountAndChannel(actorArg.url)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const actorUrl = await getUrlFromWebfinger(actor.preferredUsername + '@' + actor.getHost())
|
let actorUrl: string
|
||||||
|
try {
|
||||||
|
actorUrl = await getUrlFromWebfinger(actor.preferredUsername + '@' + actor.getHost())
|
||||||
|
} catch (err) {
|
||||||
|
logger.warn('Cannot get actor URL from webfinger, keeping the old one.', err)
|
||||||
|
actorUrl = actor.url
|
||||||
|
}
|
||||||
|
|
||||||
const { result, statusCode } = await fetchRemoteActor(actorUrl)
|
const { result, statusCode } = await fetchRemoteActor(actorUrl)
|
||||||
|
|
||||||
if (statusCode === 404) {
|
if (statusCode === 404) {
|
||||||
|
@ -429,5 +436,3 @@ async function saveVideoChannel (actor: ActorModel, result: FetchRemoteActorResu
|
||||||
|
|
||||||
return videoChannelCreated
|
return videoChannelCreated
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue