From: Chocobozzz Date: Wed, 3 Oct 2018 14:57:40 +0000 (+0200) Subject: Don't block when removing redundancy files X-Git-Tag: v1.0.0~11 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=sidebyside;h=d0ae9490a3ffd0855a970fa3980c387db08a0f89;p=github%2FChocobozzz%2FPeerTube.git Don't block when removing redundancy files --- diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index da1c6f4a7..2ebe23ef1 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts @@ -122,9 +122,13 @@ export class VideoRedundancyModel extends Model { 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) {