Explorar o código

Fix transaction when processing local viewer

Chocobozzz %!s(int64=2) %!d(string=hai) anos
pai
achega
68d6e57870
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      server/lib/activitypub/local-video-viewer.ts

+ 4 - 2
server/lib/activitypub/local-video-viewer.ts

@@ -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
   })
 }