]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix transaction when processing local viewer
authorChocobozzz <me@florianbigard.com>
Fri, 17 Jun 2022 07:03:18 +0000 (09:03 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 17 Jun 2022 07:03:28 +0000 (09:03 +0200)
server/lib/activitypub/local-video-viewer.ts

index 738083adc9b00472a0a039487cce955366c14a3a..bdd7467912883dcff4edc92b8e49b1a297344f31 100644 (file)
@@ -23,7 +23,7 @@ async function createOrUpdateLocalVideoViewer (watchAction: WatchActionObject, v
       : null,
 
     videoId: video.id
-  })
+  }, { transaction: t })
 
   await LocalVideoViewerWatchSectionModel.bulkCreateSections({
     localVideoViewerId: localVideoViewer.id,
@@ -31,7 +31,9 @@ async function createOrUpdateLocalVideoViewer (watchAction: WatchActionObject, v
     watchSections: watchAction.watchSections.map(s => ({
       start: s.startTimestamp,
       end: s.endTimestamp
-    }))
+    })),
+
+    transaction: t
   })
 }