aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/process/process-follow.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/process/process-follow.ts')
-rw-r--r--server/lib/activitypub/process/process-follow.ts13
1 files changed, 2 insertions, 11 deletions
diff --git a/server/lib/activitypub/process/process-follow.ts b/server/lib/activitypub/process/process-follow.ts
index dc1d542b5..f34fd66cc 100644
--- a/server/lib/activitypub/process/process-follow.ts
+++ b/server/lib/activitypub/process/process-follow.ts
@@ -11,7 +11,7 @@ async function processFollowActivity (activity: ActivityFollow) {
11 const activityObject = activity.object 11 const activityObject = activity.object
12 const actor = await getOrCreateActorAndServerAndModel(activity.actor) 12 const actor = await getOrCreateActorAndServerAndModel(activity.actor)
13 13
14 return processFollow(actor, activityObject) 14 return retryTransactionWrapper(processFollow, actor, activityObject)
15} 15}
16 16
17// --------------------------------------------------------------------------- 17// ---------------------------------------------------------------------------
@@ -22,16 +22,7 @@ export {
22 22
23// --------------------------------------------------------------------------- 23// ---------------------------------------------------------------------------
24 24
25function processFollow (actor: ActorModel, targetActorURL: string) { 25async function processFollow (actor: ActorModel, targetActorURL: string) {
26 const options = {
27 arguments: [ actor, targetActorURL ],
28 errorMessage: 'Cannot follow with many retries.'
29 }
30
31 return retryTransactionWrapper(follow, options)
32}
33
34async function follow (actor: ActorModel, targetActorURL: string) {
35 await sequelizeTypescript.transaction(async t => { 26 await sequelizeTypescript.transaction(async t => {
36 const targetActor = await ActorModel.loadByUrl(targetActorURL, t) 27 const targetActor = await ActorModel.loadByUrl(targetActorURL, t)
37 28