+
+ const { totalUsed } = await VideoRedundancyModel.getStats(redundancyConfig.strategy)
+
+ // If the admin decreased the cache size, remove this redundancy instead of extending it
+ if (totalUsed > redundancyConfig.size) {
+ logger.info('Destroying redundancy %s because the cache size %s is too heavy.', redundancyModel.url, redundancyModel.strategy)
+
+ await removeVideoRedundancy(redundancyModel)
+ continue
+ }
+
+ await this.extendsRedundancy(redundancyModel)