]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-live.ts
Use hook inside the transaction
[github/Chocobozzz/PeerTube.git] / server / models / video / video-live.ts
index 290e1dda73ab17faaf3e71ab7a718b6a44f80aca..1acf9cbf3f71f5dd47dc20706c68daa00f3fbee0 100644 (file)
@@ -1,6 +1,7 @@
+import { Transaction } from 'sequelize'
 import {
-  BeforeDestroy,
   AllowNull,
+  BeforeDestroy,
   BelongsTo,
   Column,
   CreatedAt,
@@ -100,11 +101,12 @@ export class VideoLiveModel extends Model<Partial<AttributesOnly<VideoLiveModel>
   ReplaySetting: VideoLiveReplaySettingModel
 
   @BeforeDestroy
-  static deleteReplaySetting (instance: VideoLiveModel) {
+  static deleteReplaySetting (instance: VideoLiveModel, options: { transaction: Transaction }) {
     return VideoLiveReplaySettingModel.destroy({
       where: {
         id: instance.replaySettingId
-      }
+      },
+      transaction: options.transaction
     })
   }