]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-view.ts
Try to speed up AP update transaction
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-view.ts
index c2d41dd2845fe2e629416795eb81863e07d3e91c..0a0231a3afb46e870559e747daae096e365df0a9 100644 (file)
@@ -24,12 +24,11 @@ async function processCreateView (activity: ActivityView | ActivityCreate, byAct
     ? activity.object
     : (activity.object as ViewObject).object
 
-  const options = {
+  const { video } = await getOrCreateAPVideo({
     videoObject,
-    fetchType: 'only-video' as 'only-video',
-    allowRefresh: false as false
-  }
-  const { video } = await getOrCreateAPVideo(options)
+    fetchType: 'only-video',
+    allowRefresh: false
+  })
 
   if (!video.isLive) {
     await Redis.Instance.addVideoView(video.id)