+ private async extendsOrDeleteRedundancy (redundancyModel: VideoRedundancyModel) {
+ // Refresh the video, maybe it was deleted
+ const video = await this.loadAndRefreshVideo(redundancyModel.VideoFile.Video.url)
+
+ if (!video) {
+ logger.info('Destroying existing redundancy %s, because the associated video does not exist anymore.', redundancyModel.url)
+
+ await redundancyModel.destroy()
+ return
+ }
+
+ const redundancy = CONFIG.REDUNDANCY.VIDEOS.STRATEGIES.find(s => s.strategy === redundancyModel.strategy)
+ await this.extendsExpirationOf(redundancyModel, redundancy.minLifetime)
+ }
+