diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-19 14:44:20 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-19 15:22:55 +0200 |
commit | e587e0ecee5bec43a225995948faaa4bc97f080a (patch) | |
tree | 6348e28eb06086d0c8586ceb91230b4a4af67053 /server/lib/activitypub/process/process-announce.ts | |
parent | d4defe07d26013a75577b30608841fe3f8334308 (diff) | |
download | PeerTube-e587e0ecee5bec43a225995948faaa4bc97f080a.tar.gz PeerTube-e587e0ecee5bec43a225995948faaa4bc97f080a.tar.zst PeerTube-e587e0ecee5bec43a225995948faaa4bc97f080a.zip |
Optimize activity actor load in AP processors
Diffstat (limited to 'server/lib/activitypub/process/process-announce.ts')
-rw-r--r-- | server/lib/activitypub/process/process-announce.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/server/lib/activitypub/process/process-announce.ts b/server/lib/activitypub/process/process-announce.ts index b968389b3..cc88b5423 100644 --- a/server/lib/activitypub/process/process-announce.ts +++ b/server/lib/activitypub/process/process-announce.ts | |||
@@ -2,15 +2,11 @@ import { ActivityAnnounce } from '../../../../shared/models/activitypub' | |||
2 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 2 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
3 | import { sequelizeTypescript } from '../../../initializers' | 3 | import { sequelizeTypescript } from '../../../initializers' |
4 | import { ActorModel } from '../../../models/activitypub/actor' | 4 | import { ActorModel } from '../../../models/activitypub/actor' |
5 | import { VideoModel } from '../../../models/video/video' | ||
6 | import { VideoShareModel } from '../../../models/video/video-share' | 5 | import { VideoShareModel } from '../../../models/video/video-share' |
7 | import { getOrCreateActorAndServerAndModel } from '../actor' | ||
8 | import { forwardVideoRelatedActivity } from '../send/utils' | 6 | import { forwardVideoRelatedActivity } from '../send/utils' |
9 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' | 7 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' |
10 | 8 | ||
11 | async function processAnnounceActivity (activity: ActivityAnnounce) { | 9 | async function processAnnounceActivity (activity: ActivityAnnounce, actorAnnouncer: ActorModel) { |
12 | const actorAnnouncer = await getOrCreateActorAndServerAndModel(activity.actor) | ||
13 | |||
14 | return retryTransactionWrapper(processVideoShare, actorAnnouncer, activity) | 10 | return retryTransactionWrapper(processVideoShare, actorAnnouncer, activity) |
15 | } | 11 | } |
16 | 12 | ||