From 911238e343e1cccae349ff9c44bcffadb96fa393 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 26 Oct 2017 14:05:20 +0200 Subject: Fix integrity issues with after destroy hook --- server/models/video/author.ts | 4 ++-- server/models/video/video-channel.ts | 4 ++-- server/models/video/video.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'server/models') diff --git a/server/models/video/author.ts b/server/models/video/author.ts index 6f27ea7bd..43f84c3ea 100644 --- a/server/models/video/author.ts +++ b/server/models/video/author.ts @@ -107,13 +107,13 @@ function associate (models) { }) } -function afterDestroy (author: AuthorInstance, options: { transaction: Sequelize.Transaction }) { +function afterDestroy (author: AuthorInstance) { if (author.isOwned()) { const removeVideoAuthorToFriendsParams = { uuid: author.uuid } - return removeVideoAuthorToFriends(removeVideoAuthorToFriendsParams, options.transaction) + return removeVideoAuthorToFriends(removeVideoAuthorToFriendsParams) } return undefined diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index e469383e9..46c2db63f 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts @@ -178,13 +178,13 @@ function associate (models) { }) } -function afterDestroy (videoChannel: VideoChannelInstance, options: { transaction: Sequelize.Transaction }) { +function afterDestroy (videoChannel: VideoChannelInstance) { if (videoChannel.isOwned()) { const removeVideoChannelToFriendsParams = { uuid: videoChannel.uuid } - return removeVideoChannelToFriends(removeVideoChannelToFriendsParams, options.transaction) + return removeVideoChannelToFriends(removeVideoChannelToFriendsParams) } return undefined diff --git a/server/models/video/video.ts b/server/models/video/video.ts index ec14939c2..6c0db59f3 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -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 -- cgit v1.2.3