]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Don't block when removing redundancy files
authorChocobozzz <me@florianbigard.com>
Wed, 3 Oct 2018 14:57:40 +0000 (16:57 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 3 Oct 2018 14:57:40 +0000 (16:57 +0200)
server/models/redundancy/video-redundancy.ts

index da1c6f4a7f11d844e5047049e44aecdffd538f10..2ebe23ef163533d638fc74dfa8ec0613fb95cdf4 100644 (file)
@@ -122,9 +122,13 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
 
     const videoFile = await VideoFileModel.loadWithVideo(instance.videoFileId)
 
-    logger.info('Removing duplicated video file %s-%s.', videoFile.Video.uuid, videoFile.resolution)
+    const logIdentifier = `${videoFile.Video.uuid}-${videoFile.resolution}`
+    logger.info('Removing duplicated video file %s.', logIdentifier)
 
-    return videoFile.Video.removeFile(videoFile)
+    videoFile.Video.removeFile(videoFile)
+             .catch(err => logger.error('Cannot delete %s files.', logIdentifier, { err }))
+
+    return undefined
   }
 
   static async loadLocalByFileId (videoFileId: number) {