]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/videos.ts
Refractor retry transaction function
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / videos.ts
index 7ec8ca193ad38f0b79e9ea89b8b7f5713eb7022f..a16828fda22aa5fa6845bca7ce5b765a68869e81 100644 (file)
@@ -228,12 +228,7 @@ async function getOrCreateAccountAndVideoAndChannel (videoObject: VideoTorrentOb
 
   const channelActor = await getOrCreateVideoChannel(videoObject)
 
-  const options = {
-    arguments: [ videoObject, channelActor ],
-    errorMessage: 'Cannot insert the remote video with many retries.'
-  }
-
-  const video = await retryTransactionWrapper(getOrCreateVideo, options)
+  const video = await retryTransactionWrapper(getOrCreateVideo, videoObject, channelActor)
 
   // Process outside the transaction because we could fetch remote data
   logger.info('Adding likes of video %s.', video.uuid)