]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video.ts
Fix integrity issues with after destroy hook
[github/Chocobozzz/PeerTube.git] / server / models / video / video.ts
index 01a801da30cd4f6f726d92ea93f9980b91a7b5d7..6c0db59f322ae0160ff6435fc300dfe3a4e899bd 100644 (file)
@@ -317,7 +317,7 @@ function associate (models) {
   })
 }
 
-function afterDestroy (video: VideoInstance, options: { transaction: Sequelize.Transaction }) {
+function afterDestroy (video: VideoInstance) {
   const tasks = []
 
   tasks.push(
@@ -331,7 +331,7 @@ function afterDestroy (video: VideoInstance, options: { transaction: Sequelize.T
 
     tasks.push(
       video.removePreview(),
-      removeVideoToFriends(removeVideoToFriendsParams, options.transaction)
+      removeVideoToFriends(removeVideoToFriendsParams)
     )
 
     // Remove physical files and torrents
@@ -343,7 +343,7 @@ function afterDestroy (video: VideoInstance, options: { transaction: Sequelize.T
 
   return Promise.all(tasks)
     .catch(err => {
-      logger.error('Some errors when removing files of video %d in after destroy hook.', video.uuid, err)
+      logger.error('Some errors when removing files of video %s in after destroy hook.', video.uuid, err)
     })
 }