diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 09:28:35 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 09:28:35 +0200 |
commit | 9fd540562c356cb54b98861d2d9e7d4fbfcd00e0 (patch) | |
tree | d95149e0e921b4d309e2766cf9566dc0928ae9e5 /server/models | |
parent | 4dd551a06642351786c28d39fe3fe29939baca54 (diff) | |
download | PeerTube-9fd540562c356cb54b98861d2d9e7d4fbfcd00e0.tar.gz PeerTube-9fd540562c356cb54b98861d2d9e7d4fbfcd00e0.tar.zst PeerTube-9fd540562c356cb54b98861d2d9e7d4fbfcd00e0.zip |
Fix video removing when it is corrupted
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index fb18a485a..4bd8eb98f 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -334,12 +334,15 @@ function afterDestroy (video: VideoInstance, options: { transaction: Sequelize.T | |||
334 | 334 | ||
335 | // Remove physical files and torrents | 335 | // Remove physical files and torrents |
336 | video.VideoFiles.forEach(file => { | 336 | video.VideoFiles.forEach(file => { |
337 | video.removeFile(file), | 337 | tasks.push(video.removeFile(file)) |
338 | video.removeTorrent(file) | 338 | tasks.push(video.removeTorrent(file)) |
339 | }) | 339 | }) |
340 | } | 340 | } |
341 | 341 | ||
342 | return Promise.all(tasks) | 342 | return Promise.all(tasks) |
343 | .catch(err => { | ||
344 | logger.error('Some errors when removing files of video %d in after destroy hook.', video.uuid, err) | ||
345 | }) | ||
343 | } | 346 | } |
344 | 347 | ||
345 | getOriginalFile = function (this: VideoInstance) { | 348 | getOriginalFile = function (this: VideoInstance) { |