]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-announce.ts
Fix lint
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-announce.ts
index 4e50da8d2fe36f02115e65fb3512778e810d3332..d8ca594259b6d0bff65cef7114dd0c9e5b747f3a 100644 (file)
@@ -11,7 +11,7 @@ import { getOrCreateAccountAndVideoAndChannel } from '../videos'
 async function processAnnounceActivity (activity: ActivityAnnounce) {
   const actorAnnouncer = await getOrCreateActorAndServerAndModel(activity.actor)
 
-  return processVideoShare(actorAnnouncer, activity)
+  return retryTransactionWrapper(processVideoShare, actorAnnouncer, activity)
 }
 
 // ---------------------------------------------------------------------------
@@ -22,16 +22,7 @@ export {
 
 // ---------------------------------------------------------------------------
 
-function processVideoShare (actorAnnouncer: ActorModel, activity: ActivityAnnounce) {
-  const options = {
-    arguments: [ actorAnnouncer, activity ],
-    errorMessage: 'Cannot share the video activity with many retries.'
-  }
-
-  return retryTransactionWrapper(shareVideo, options)
-}
-
-async function shareVideo (actorAnnouncer: ActorModel, activity: ActivityAnnounce) {
+async function processVideoShare (actorAnnouncer: ActorModel, activity: ActivityAnnounce) {
   const objectUri = typeof activity.object === 'string' ? activity.object : activity.object.id
   let video: VideoModel