]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-follow.ts
Flat shared module directory
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-follow.ts
index dc1d542b50903cb0b6de34f1da71e6fa4bc48901..f34fd66cc24e953882dfb0d94d76391db3b3b1af 100644 (file)
@@ -11,7 +11,7 @@ async function processFollowActivity (activity: ActivityFollow) {
   const activityObject = activity.object
   const actor = await getOrCreateActorAndServerAndModel(activity.actor)
 
-  return processFollow(actor, activityObject)
+  return retryTransactionWrapper(processFollow, actor, activityObject)
 }
 
 // ---------------------------------------------------------------------------
@@ -22,16 +22,7 @@ export {
 
 // ---------------------------------------------------------------------------
 
-function processFollow (actor: ActorModel, targetActorURL: string) {
-  const options = {
-    arguments: [ actor, targetActorURL ],
-    errorMessage: 'Cannot follow with many retries.'
-  }
-
-  return retryTransactionWrapper(follow, options)
-}
-
-async function follow (actor: ActorModel, targetActorURL: string) {
+async function processFollow (actor: ActorModel, targetActorURL: string) {
   await sequelizeTypescript.transaction(async t => {
     const targetActor = await ActorModel.loadByUrl(targetActorURL, t)