mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Optimize activity actor load in AP processors
This commit is contained in:
parent
d4defe07d2
commit
e587e0ecee
16 changed files with 110 additions and 89 deletions
13
server/helpers/actor.ts
Normal file
13
server/helpers/actor.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { ActorModel } from '../models/activitypub/actor'
|
||||
|
||||
type ActorFetchByUrlType = 'all' | 'actor-and-association-ids'
|
||||
function fetchActorByUrl (url: string, fetchType: ActorFetchByUrlType) {
|
||||
if (fetchType === 'all') return ActorModel.loadByUrlAndPopulateAccountAndChannel(url)
|
||||
|
||||
if (fetchType === 'actor-and-association-ids') return ActorModel.loadByUrl(url)
|
||||
}
|
||||
|
||||
export {
|
||||
ActorFetchByUrlType,
|
||||
fetchActorByUrl
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue